fix wrong template being shown on error when changing colors

remotes/1693045480750635534/spooky-22
Aevann1 2022-06-24 00:22:41 +02:00
parent 39a5971db7
commit 6803d83af4
1 changed files with 3 additions and 3 deletions

View File

@ -339,8 +339,8 @@ def namecolor(v):
color = request.values.get("color", "").strip().lower()
if color.startswith('#'): color = color[1:]
if len(color) != 6: return render_template("settings_security.html", v=v, error="Invalid color code")
if color == '21262c': return render_template("settings_security.html", v=v, error="This color is not allowed")
if len(color) != 6: return render_template("settings_profile.html", v=v, error="Invalid color code")
if color == '21262c': return render_template("settings_profile.html", v=v, error="This color is not allowed")
v.namecolor = color
g.db.add(v)
g.db.commit()
@ -354,7 +354,7 @@ def themecolor(v):
themecolor = str(request.values.get("themecolor", "")).strip()
if themecolor.startswith('#'): themecolor = themecolor[1:]
if len(themecolor) != 6: return render_template("settings_security.html", v=v, error="Invalid color code")
if len(themecolor) != 6: return render_template("settings_profile.html", v=v, error="Invalid color code")
v.themecolor = themecolor
g.db.add(v)
g.db.commit()