Fix issue where current theme cannot be found in list of themes (#2079)

* Fix issue where current theme cannot be found in list of themes
This commit is contained in:
Kevin Chung
2022-03-30 12:16:34 -04:00
committed by GitHub
parent 00bb891457
commit a2e7a32754

View File

@@ -174,7 +174,12 @@ def config():
configs = {c.key: get_config(c.key) for c in configs}
themes = ctf_config.get_themes()
themes.remove(get_config("ctf_theme"))
# Remove current theme but ignore failure
try:
themes.remove(get_config("ctf_theme"))
except ValueError:
pass
return render_template("admin/config.html", themes=themes, **configs)