Fix loading blocked raw sites
This commit is contained in:
parent
d2627f36d5
commit
61ac6a30d3
1 changed files with 2 additions and 2 deletions
|
@ -25,6 +25,8 @@ class UiRequestPlugin(object):
|
||||||
file_generator = super(UiRequestPlugin, self).actionSiteMedia(path, **kwargs)
|
file_generator = super(UiRequestPlugin, self).actionSiteMedia(path, **kwargs)
|
||||||
if "__next__" in dir(file_generator): # File found and generator returned
|
if "__next__" in dir(file_generator): # File found and generator returned
|
||||||
site = self.server.sites.get(path_parts["address"])
|
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)
|
return self.actionPatchFile(site, path_parts["inner_path"], file_generator)
|
||||||
else:
|
else:
|
||||||
return file_generator
|
return file_generator
|
||||||
|
@ -45,8 +47,6 @@ class UiRequestPlugin(object):
|
||||||
|
|
||||||
def actionPatchFile(self, site, inner_path, file_generator):
|
def actionPatchFile(self, site, inner_path, file_generator):
|
||||||
content_json = site.content_manager.contents.get("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)
|
||||||
|
|
Loading…
Reference in a new issue