From 4c9181e0b15f009358657f71cb14211ec3bb73c6 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 27 Jan 2023 12:02:11 +0200 Subject: [PATCH] save failed profilecss --- files/routes/settings.py | 6 +++--- files/templates/settings/css.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/files/routes/settings.py b/files/routes/settings.py index d804e075d..f2ebb1359 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -616,7 +616,7 @@ def settings_css(v): v.css = css g.db.add(v) - return render_template("settings/css.html", v=v, msg="Custom CSS successfully updated!") + return render_template("settings/css.html", v=v, msg="Custom CSS successfully updated!", profilecss=v.profilecss) @app.post("/settings/profilecss") @limiter.limit(DEFAULT_RATELIMIT_SLOWER) @@ -626,10 +626,10 @@ def settings_profilecss(v): profilecss = request.values.get("profilecss", v.profilecss).strip().replace('\\', '').strip()[:CSS_LENGTH_LIMIT] valid, error = validate_css(profilecss) if not valid: - return render_template("settings/css.html", error=error, v=v) + return render_template("settings/css.html", error=error, v=v, profilecss=profilecss) v.profilecss = profilecss g.db.add(v) - return render_template("settings/css.html", v=v, msg="Profile CSS successfully updated!") + return render_template("settings/css.html", v=v, msg="Profile CSS successfully updated!", profilecss=v.profilecss) @app.get("/settings/security") @limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID) diff --git a/files/templates/settings/css.html b/files/templates/settings/css.html index 3e28a6c60..7143bfec5 100644 --- a/files/templates/settings/css.html +++ b/files/templates/settings/css.html @@ -29,7 +29,7 @@
- + Limit of {{CSS_LENGTH_LIMIT}} characters