Use default theme-class for corrupt users.json file
where settings key is missing etc Fixes Ui.UiServer Error 500: UiWSGIHandler error
This commit is contained in:
parent
77b4297224
commit
c354f9e24d
1 changed files with 4 additions and 1 deletions
|
@ -749,7 +749,10 @@ class UiRequest(object):
|
||||||
|
|
||||||
def replaceHtmlVariables(self, block, path_parts):
|
def replaceHtmlVariables(self, block, path_parts):
|
||||||
user = self.getCurrentUser()
|
user = self.getCurrentUser()
|
||||||
themeclass = "theme-%-6s" % re.sub("[^a-z]", "", user.settings.get("theme", "light"))
|
if user and user.settings:
|
||||||
|
themeclass = "theme-%-6s" % re.sub("[^a-z]", "", user.settings.get("theme", "light"))
|
||||||
|
else:
|
||||||
|
themeclass = "theme-light"
|
||||||
block = block.replace(b"{themeclass}", themeclass.encode("utf8"))
|
block = block.replace(b"{themeclass}", themeclass.encode("utf8"))
|
||||||
|
|
||||||
if path_parts:
|
if path_parts:
|
||||||
|
|
Loading…
Reference in a new issue