From b517e7e71441a5d9c1414e1774c060712920d5df Mon Sep 17 00:00:00 2001 From: Alvin Chow Date: Tue, 29 Sep 2015 17:12:58 -0700 Subject: [PATCH] Fix bug where any page update would invoke rename_page() fix --- realms/modules/wiki/models.py | 3 +++ realms/modules/wiki/views.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/realms/modules/wiki/models.py b/realms/modules/wiki/models.py index 8d7a310..8e69612 100644 --- a/realms/modules/wiki/models.py +++ b/realms/modules/wiki/models.py @@ -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 diff --git a/realms/modules/wiki/views.py b/realms/modules/wiki/views.py index 3fda3cb..02e3d25 100644 --- a/realms/modules/wiki/views.py +++ b/realms/modules/wiki/views.py @@ -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,