Fix file rendering if content.json download failed

This commit is contained in:
shortcutme 2019-11-11 16:18:25 +01:00
parent e8b0a3d1c4
commit ac69007292
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -44,7 +44,9 @@ class UiRequestPlugin(object):
return file_generator return file_generator
def actionPatchFile(self, site, inner_path, file_generator): def actionPatchFile(self, site, inner_path, file_generator):
content_json = site.content_manager.contents["content.json"] content_json = site.content_manager.contents.get("content.json")
if not content_json:
return file_generator
lang_file = "languages/%s.json" % translate.lang lang_file = "languages/%s.json" % translate.lang
lang_file_exist = False lang_file_exist = False
if site.settings.get("own"): # My site, check if the file is exist (allow to add new lang without signing) if site.settings.get("own"): # My site, check if the file is exist (allow to add new lang without signing)