From f7697a0c887b388d73812dd4bfb8dbf96589a484 Mon Sep 17 00:00:00 2001 From: fireworks88 Date: Fri, 23 Jul 2021 22:16:41 +0200 Subject: [PATCH] sneed --- drama/routes/errors.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drama/routes/errors.py b/drama/routes/errors.py index 4f9a477f6..dc9452eb6 100644 --- a/drama/routes/errors.py +++ b/drama/routes/errors.py @@ -1,3 +1,5 @@ +import jinja2.exceptions + from drama.helpers.wrappers import * from drama.helpers.session import * from drama.classes.custom_errors import * @@ -195,10 +197,12 @@ def allow_nsfl_logged_out(bid, v): return redirect(request.form.get("redir")) -@app.route("/error/", methods=["GET"]) +@app.route("/error/", methods=["GET"]) @auth_desired -def error_all_preview(eid, v): +def error_all_preview(error, v): - eid=int(eid) - return render_template(f"errors/{eid}.html", v=v) + try: + return render_template(f"errors/{error}.html", v=v) + except jinja2.exceptions.TemplateNotFound: + abort(400)