diff --git a/wikibot.py b/wikibot.py index 8f4f5e9b9030630c4279e1d31a8ff64ad7848f62..f0d7f4128baed49ea2344b447438f7143929116a 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