Fix bug where any page update would invoke rename_page()

fix
This commit is contained in:
Alvin Chow 2015-09-29 17:12:58 -07:00
parent 4ef08cc988
commit b517e7e714
2 changed files with 4 additions and 1 deletions

View file

@ -118,6 +118,9 @@ class Wiki(HookMixin):
# old doesn't exist
return None
if old_filename == new_filename:
return
if new_filename in self.gittle.index:
# file is being overwritten, but that is ok, it's git!
pass

View file

@ -140,7 +140,7 @@ def page_write(name):
if edit_cname in current_app.config.get('WIKI_LOCKED_PAGES'):
return dict(error=True, message="Page is locked"), 403
if edit_cname != cname.lower():
if edit_cname != cname:
g.current_wiki.rename_page(cname, edit_cname)
sha = g.current_wiki.write_page(edit_cname,