From a2e7a3275491a35b2c0f40f32dd4481bb9d1023d Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Wed, 30 Mar 2022 12:16:34 -0400 Subject: [PATCH] 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 --- CTFd/admin/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CTFd/admin/__init__.py b/CTFd/admin/__init__.py index f31dfba7..51aa5078 100644 --- a/CTFd/admin/__init__.py +++ b/CTFd/admin/__init__.py @@ -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)