build available theme list dynamically
This commit is contained in:
@ -169,6 +169,9 @@ def get_prefers_theme():
|
||||
if not 'theme' in session:
|
||||
return 'style'
|
||||
|
||||
if session['theme'] not in current_app.config['allowed_themes']:
|
||||
return 'style'
|
||||
|
||||
return session['theme']
|
||||
|
||||
@bp.get("/log_in")
|
||||
@ -294,8 +297,8 @@ def settings_form(username):
|
||||
# we silently ignore the passed username
|
||||
# and grab the correct user from the session
|
||||
user = get_active_user()
|
||||
theme = request.form.get('theme', default='default')
|
||||
if theme == 'default':
|
||||
theme = request.form.get('theme', default='style')
|
||||
if theme == 'style':
|
||||
if 'theme' in session:
|
||||
session.pop('theme')
|
||||
else:
|
||||
|
Reference in New Issue
Block a user