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
523951f85c
commit
bada2bdb5d
1 changed files with 4 additions and 1 deletions
|
@ -749,7 +749,10 @@ class UiRequest(object):
|
|||
|
||||
def replaceHtmlVariables(self, block, path_parts):
|
||||
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"))
|
||||
|
||||
if path_parts:
|
||||
|
|
Loading…
Reference in a new issue