From db1c6b70594e7bf9084030a5a049aee30231f98e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 26 Mar 2022 20:35:44 +0200 Subject: [PATCH] sfd --- files/routes/settings.py | 6 +++++- files/templates/settings_profile.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/files/routes/settings.py b/files/routes/settings.py index b10c66065..c02e06f70 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -34,6 +34,7 @@ tiers={ @auth_required def removebackground(v): v.background = None + v.theme = 'midnight' g.db.add(v) g.db.commit() return {"message": "Background removed!"} @@ -326,7 +327,10 @@ def settings_profile_post(v): theme = request.values.get("theme") if theme: - if theme in {"dramblr", "classic", "classic_dark", "win98", "dark", "light", "coffee", "tron", "4chan", "midnight"}: + if theme in {"dramblr", "classic", "classic_dark", "transparent", "win98", "dark", "light", "coffee", "tron", "4chan", "midnight"}: + if theme == "transparent" and not v.background: + return {"error": "You need to set a background to use the transparent theme!"} + if theme != "transparent": v.background = None v.theme = theme if theme == "win98": v.themecolor = "30409f" updated = True diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 17807e6c4..7a7a9e476 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -115,7 +115,7 @@

Change the theme for the website.