added proper http codes

This commit is contained in:
2026-01-15 00:36:27 +01:00
parent 8433905e65
commit 8f63f8a7ef

View File

@@ -158,7 +158,7 @@ def ratelimit_handler(e):
msg = Message('429 Ratelimit hit', recipients=["simon.bussmann@tum.de"])
msg.body = f"IP {request.remote_addr} triggered the rate limit"
mail.send(msg)
return render_template("ratelimit_error.html", error_message=e.description)
return render_template("ratelimit_error.html", error_message=e.description), 429
@bp.errorhandler(500)
def server_error(e):
@@ -168,4 +168,4 @@ def server_error(e):
msg.body = f"An error occurred during registration:\n\n{full_traceback}"
mail.send(msg)
return render_template("error.html", error_message="Internal Server Error. Admin has been notified!")
return render_template("error.html", error_message="Internal Server Error. Admin has been notified!"), 500