Skip to content

Commit

Permalink
Dont add -old postfix for content.json files
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Apr 25, 2016
1 parent 34ead0a commit 038bf4f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Ui/UiWebsocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def actionSiteSign(self, to, privatekey=None, inner_path="content.json", respons
return

site.content_manager.loadContent(inner_path, add_bad_files=False) # Load new content.json, ignore errors

if response_ok:
self.response(to, "ok")

Expand Down Expand Up @@ -383,7 +384,10 @@ def actionFileWrite(self, to, inner_path, content_base64):
import base64
content = base64.b64decode(content_base64)
# Save old file to generate patch later
if inner_path.endswith(".json") and self.site.storage.isFile(inner_path) and not self.site.storage.isFile(inner_path + "-old"):
if (
inner_path.endswith(".json") and not inner_path.endswith("content.json") and
self.site.storage.isFile(inner_path) and not self.site.storage.isFile(inner_path + "-old")
):
try:
self.site.storage.rename(inner_path, inner_path + "-old")
except Exception:
Expand Down

0 comments on commit 038bf4f

Please sign in to comment.