remove of upsert 404 error pages into database

This commit is contained in:
2025-10-24 19:40:37 +02:00
parent b88c01c884
commit ae4995f49c
-5
View File
@@ -16,12 +16,7 @@ async def not_found(e):
except LookupError as e: except LookupError as e:
return await to_many_requests(e) return await to_many_requests(e)
if request.path.startswith("/api"):
return jsonify({"error": "Page Not Found", "message": "Oops! The page you are looking for does not exist."}), 404
await logger.error(f"[404] Page Not Found: {request.path}") await logger.error(f"[404] Page Not Found: {request.path}")
await current_app.edgedb.upsert_page_not_found(request.path)
return await render_template('views/basics/error.htm', return await render_template('views/basics/error.htm',
title='Page Not Found', title='Page Not Found',
header={'title': '404 - Page Not Found', 'message': "Oops! The page you are looking for does not exist."}, header={'title': '404 - Page Not Found', 'message': "Oops! The page you are looking for does not exist."},