diff --git a/files/routes/awards.py b/files/routes/awards.py index 80a617730..367f095ac 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -168,7 +168,7 @@ def buy(v, award): @validate_formkey def award_post(pid, v): - if v.shadowbanned: return render_template('errors/500.html', v=v), 500 + if v.shadowbanned: return render_template('errors/500.html', error=True, v=v), 500 if v.is_banned and not v.unban_utc: return {"error": "forbidden."}, 403 @@ -339,7 +339,7 @@ def award_post(pid, v): @validate_formkey def award_comment(cid, v): - if v.shadowbanned: return render_template('errors/500.html', v=v), 500 + if v.shadowbanned: return render_template('errors/500.html', error=True, v=v), 500 if v.is_suspended and v.unban_utc == 0: return {"error": "forbidden"}, 403 diff --git a/files/routes/errors.py b/files/routes/errors.py index 980095c87..79676b2ec 100644 --- a/files/routes/errors.py +++ b/files/routes/errors.py @@ -15,7 +15,7 @@ from files.__main__ import app, limiter @auth_desired def error_400(e, v): if request.headers.get("Authorization"): return {"error": "400 Bad Request"}, 400 - else: return render_template('errors/400.html', v=v), 400 + else: return render_template('errors/400.html', error=True, v=v), 400 @app.errorhandler(401) def error_401(e): @@ -33,28 +33,28 @@ def error_401(e): @auth_desired def error_403(e, v): if request.headers.get("Authorization"): return {"error": "403 Forbidden"}, 403 - else: return render_template('errors/403.html', v=v), 403 + else: return render_template('errors/403.html', error=True, v=v), 403 @app.errorhandler(404) @auth_desired def error_404(e, v): if request.headers.get("Authorization"): return {"error": "404 Not Found"}, 404 - else: return render_template('errors/404.html', v=v), 404 + else: return render_template('errors/404.html', error=True, v=v), 404 @app.errorhandler(405) @auth_desired def error_405(e, v): if request.headers.get("Authorization"): return {"error": "405 Method Not Allowed"}, 405 - else: return render_template('errors/405.html', v=v), 405 + else: return render_template('errors/405.html', error=True, v=v), 405 @app.errorhandler(429) @auth_desired def error_429(e, v): if request.headers.get("Authorization"): return {"error": "429 Too Many Requests"}, 429 - else: return render_template('errors/429.html', v=v), 429 + else: return render_template('errors/429.html', error=True, v=v), 429 @app.errorhandler(500) @@ -63,7 +63,7 @@ def error_500(e, v): g.db.rollback() if request.headers.get("Authorization"): return {"error": "500 Internal Server Error"}, 500 - else: return render_template('errors/500.html', v=v), 500 + else: return render_template('errors/500.html', error=True, v=v), 500 @app.post("/allow_nsfw") @@ -78,7 +78,7 @@ def allow_nsfw(): def error_all_preview(error, v): try: - return render_template(f"errors/{error}.html", v=v) + return render_template(f"errors/{error}.html", error=True, v=v) except jinja2.exceptions.TemplateNotFound: abort(400) diff --git a/files/routes/front.py b/files/routes/front.py index d03e257b7..84aad6e04 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -125,7 +125,7 @@ def front_all(v): if not v and request.path == "/" and not request.headers.get("Authorization"): return redirect(f"/logged_out{request.full_path}") - if v and v.is_banned and not v.unban_utc: return render_template('errors/500.html', v=v), 500 + if v and v.is_banned and not v.unban_utc: return render_template('errors/500.html', error=True, v=v), 500 if v and request.path.startswith('/logged_out'): v = None diff --git a/files/routes/votes.py b/files/routes/votes.py index fdf3e83ca..877ecd9aa 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -16,7 +16,7 @@ defaultcolor = environ.get("DEFAULT_COLOR").strip() @auth_desired def admin_vote_info_get(v): - if v and v.shadowbanned: return render_template('errors/500.html', v=v), 500 + if v and v.shadowbanned: return render_template('errors/500.html', error=True, v=v), 500 link = request.values.get("link") if not link: return render_template("votes.html", v=v) @@ -27,7 +27,7 @@ def admin_vote_info_get(v): else: abort(400) except: abort(400) - if thing.author.shadowbanned and not (v and v.admin_level): return render_template('errors/500.html', v=v), 500 + if thing.author.shadowbanned and not (v and v.admin_level): return render_template('errors/500.html', error=True, v=v), 500 if isinstance(thing, Submission): diff --git a/files/templates/CHRISTMAS/header-tw.html b/files/templates/CHRISTMAS/header-tw.html index 20af72dae..72782b255 100644 --- a/files/templates/CHRISTMAS/header-tw.html +++ b/files/templates/CHRISTMAS/header-tw.html @@ -4,6 +4,7 @@