Skip to content

Commit

Permalink
Load content.json content before signing
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Mar 12, 2017
1 parent ec513f0 commit 2473a09
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Content/ContentManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,16 @@ def sign(self, inner_path="content.json", privatekey=None, filewrite=True, updat
content = None
if not content: # Content not exist yet, load default one
self.log.info("File %s not exist yet, loading default values..." % inner_path)
content = {"files": {}, "signs": {}} # Default content.json

if self.site.storage.isFile(inner_path):
content = self.site.storage.loadJson(inner_path)
if "files" not in content:
content["files"] = {}
if "signs" not in content:
content["signs"] = {}
else:
content = {"files": {}, "signs": {}} # Default content.json

if inner_path == "content.json": # It's the root content.json, add some more fields
content["title"] = "%s - ZeroNet_" % self.site.address
content["description"] = ""
Expand Down

0 comments on commit 2473a09

Please sign in to comment.