Ignore content if file not found on signing

This commit is contained in:
shortcutme 2017-04-07 18:16:58 +02:00
parent de14c55311
commit c6792b7674
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -495,8 +495,8 @@ class ContentManager(object):
# Return: The new content if filewrite = False
def sign(self, inner_path="content.json", privatekey=None, filewrite=True, update_changed_files=False, extend=None, remove_missing_optional=False):
if inner_path in self.contents:
content = self.contents[inner_path]
if self.contents[inner_path].get("cert_sign", False) is None and self.site.storage.isFile(inner_path):
content = self.contents.get(inner_path)
if content and content.get("cert_sign", False) is None and self.site.storage.isFile(inner_path):
# Recover cert_sign from file
content["cert_sign"] = self.site.storage.loadJson(inner_path).get("cert_sign")
else: