From 1e8671823266a436e7d4b8271362179c9fbbab60 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Tue, 3 Mar 2020 00:24:57 -0500 Subject: [PATCH] Fix setting theme color from the setup flow (#1273) * Fix setting theme color from the setup flow --- CTFd/views.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CTFd/views.py b/CTFd/views.py index f803421..a8851bc 100644 --- a/CTFd/views.py +++ b/CTFd/views.py @@ -71,14 +71,17 @@ def setup(): theme = request.form.get("ctf_theme", "core") set_config("ctf_theme", theme) theme_color = request.form.get("theme_color") - if theme_color: + theme_header = get_config("theme_header") + if theme_color and bool(theme_header) is False: # Uses {{ and }} to insert curly braces while using the format method css = ( + '\n" ).format(theme_color=theme_color) - set_config("css", css) + set_config("theme_header", css) # DateTime start = request.form.get("start")