Skip to content

Commit c354f9e

Browse files
committed
Use default theme-class for corrupt users.json file
where settings key is missing etc Fixes Ui.UiServer Error 500: UiWSGIHandler error
1 parent 77b4297 commit c354f9e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Ui/UiRequest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,10 @@ def actionSiteAddPrompt(self, path):
749749

750750
def replaceHtmlVariables(self, block, path_parts):
751751
user = self.getCurrentUser()
752-
themeclass = "theme-%-6s" % re.sub("[^a-z]", "", user.settings.get("theme", "light"))
752+
if user and user.settings:
753+
themeclass = "theme-%-6s" % re.sub("[^a-z]", "", user.settings.get("theme", "light"))
754+
else:
755+
themeclass = "theme-light"
753756
block = block.replace(b"{themeclass}", themeclass.encode("utf8"))
754757

755758
if path_parts:

0 commit comments

Comments
 (0)