Skip to content
Snippets Groups Projects
Commit bf0b5686 authored by Magnus Giesbert's avatar Magnus Giesbert
Browse files

Avoid creating formerly empty pages, that say they were moved.

parent c17bfe8b
Branches
No related tags found
No related merge requests found
...@@ -28,6 +28,8 @@ def move_page(old_pagename, new_pagename, delete=False): ...@@ -28,6 +28,8 @@ def move_page(old_pagename, new_pagename, delete=False):
with Proxy(config.WIKI_API_URL) as proxy: with Proxy(config.WIKI_API_URL) as proxy:
# create new page with identical content # # create new page with identical content #
page_content = proxy.wiki.getPage(old_pagename) page_content = proxy.wiki.getPage(old_pagename)
if not page_content:
return
proxy.wiki.putPage(new_pagename, page_content, { proxy.wiki.putPage(new_pagename, page_content, {
"sum": "Moved from " + old_pagename}) "sum": "Moved from " + old_pagename})
# update back links to new page # update back links to new page
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment