Fix loading blocked raw sites

This commit is contained in:
shortcutme 2020-02-13 17:24:22 +01:00
parent d2627f36d5
commit 61ac6a30d3
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 2 additions and 2 deletions

View File

@ -25,6 +25,8 @@ class UiRequestPlugin(object):
file_generator = super(UiRequestPlugin, self).actionSiteMedia(path, **kwargs)
if "__next__" in dir(file_generator): # File found and generator returned
site = self.server.sites.get(path_parts["address"])
if not site or not site.content_manager.contents.get("content.json"):
return file_generator
return self.actionPatchFile(site, path_parts["inner_path"], file_generator)
else:
return file_generator
@ -45,8 +47,6 @@ class UiRequestPlugin(object):
def actionPatchFile(self, site, inner_path, file_generator):
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_exist = False
if site.settings.get("own"): # My site, check if the file is exist (allow to add new lang without signing)