mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 05:54:19 +01:00
Fix edge case where invalid theme_settings cause broken frontend (#2034)
* Fix edge case where invalid `theme_settings` cause broken frontend
This commit is contained in:
@@ -76,7 +76,10 @@ class _ConfigsWrapper:
|
||||
|
||||
@property
|
||||
def theme_settings(self):
|
||||
return json.loads(get_config("theme_settings", default="null"))
|
||||
try:
|
||||
return json.loads(get_config("theme_settings", default="null"))
|
||||
except json.JSONDecodeError:
|
||||
return {"error": "invalid theme_settings"}
|
||||
|
||||
@property
|
||||
def tos_or_privacy(self):
|
||||
|
||||
@@ -410,6 +410,7 @@ $(() => {
|
||||
{
|
||||
lineNumbers: true,
|
||||
lineWrapping: true,
|
||||
readOnly: true,
|
||||
mode: { name: "javascript", json: true }
|
||||
}
|
||||
);
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user