This commit is contained in:
Zeecka
2025-06-15 18:14:47 +02:00
parent 57e7b77561
commit e937d4fc11
5 changed files with 27 additions and 0 deletions
+5
View File
@@ -38,6 +38,11 @@ def too_large(_: Any) -> tuple[Response, int]:
return jsonify({"error": "Image size exceeded"}), 413
@app.errorhandler(404)
def not_found(e):
return render_template("error.html", message="Ressource not found", statuscode=404)
@app.route("/")
def index() -> str:
"""Render the main index page."""
+5
View File
@@ -47,4 +47,9 @@ def cleanup_old_entries() -> None:
shutil.rmtree(RESULT_FOLDER / img.hash) # type: ignore
db.session.delete(img)
# Delete Images with missing submission
if len(img.submissions) == 0 and delay > MAX_PENDING_TIME:
shutil.rmtree(RESULT_FOLDER / img.hash) # type: ignore
db.session.delete(img)
db.session.commit()
+7
View File
@@ -407,4 +407,11 @@ footer a i {
.glow-border {
border: 1px solid var(--theme-green);
box-shadow: 0 0 10px var(--theme-green-shadow);
}
#httperror{
padding-top: 100px;
}
#httperror h1, #httperror h2{
text-align: center;
}
+8
View File
@@ -0,0 +1,8 @@
{% extends 'base.html' %}
{% block body_content %}
<div id="httperror">
<h1>{{ statuscode }}</h1>
<br>
<h2>{{ message }}</h2>
</div>
{% endblock %}