Load content.json content before signing

This commit is contained in:
shortcutme 2017-03-12 13:13:30 +01:00
parent ec513f0b60
commit 2473a09f7b
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -503,7 +503,16 @@ class ContentManager(object):
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"] = ""