From bf0b5686ac4c575aca7f6aa6740a360face7798e Mon Sep 17 00:00:00 2001 From: magnus <magnus@fsmpi.rwth-aachen.de> Date: Sat, 13 Aug 2022 09:25:19 +0200 Subject: [PATCH] Avoid creating formerly empty pages, that say they were moved. --- wikibot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wikibot.py b/wikibot.py index 8f4f5e9..f0d7f41 100644 --- a/wikibot.py +++ b/wikibot.py @@ -28,6 +28,8 @@ def move_page(old_pagename, new_pagename, delete=False): with Proxy(config.WIKI_API_URL) as proxy: # create new page with identical content # page_content = proxy.wiki.getPage(old_pagename) + if not page_content: + return proxy.wiki.putPage(new_pagename, page_content, { "sum": "Moved from " + old_pagename}) # update back links to new page -- GitLab