From 5e4fabb24c5426ad998bdf94a691d006fed7f32f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Gol=C3=A1=C5=88=20jr=2E?= Date: Sat, 9 Aug 2025 15:08:50 +0200 Subject: [PATCH] fix: more template fixups --- src/quart_imp/_cli/filelib/api_blueprint.py | 2 +- src/quart_imp/_cli/filelib/resources.py | 22 ++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/quart_imp/_cli/filelib/api_blueprint.py b/src/quart_imp/_cli/filelib/api_blueprint.py index fc8bba6..eb68908 100644 --- a/src/quart_imp/_cli/filelib/api_blueprint.py +++ b/src/quart_imp/_cli/filelib/api_blueprint.py @@ -20,5 +20,5 @@ from .. import bp @bp.route("/", methods=["GET"]) async def index(): - return await {"message": "Hello, World!"} + return {"message": "Hello, World!"} """ diff --git a/src/quart_imp/_cli/filelib/resources.py b/src/quart_imp/_cli/filelib/resources.py index cb9f0df..099478f 100644 --- a/src/quart_imp/_cli/filelib/resources.py +++ b/src/quart_imp/_cli/filelib/resources.py @@ -37,7 +37,7 @@ from quart import render_template @app.errorhandler(400) async def bad_request(e): - return render_template( + return await render_template( "error.html", error_code=400, error_message="The request is invalid.", @@ -46,7 +46,7 @@ async def bad_request(e): @app.errorhandler(401) async def unauthorized(e): - return render_template( + return await render_template( "error.html", error_code=401, error_message="You are not authorized to access this page.", @@ -55,7 +55,7 @@ async def unauthorized(e): @app.errorhandler(403) async def forbidden(e): - return render_template( + return await render_template( "error.html", error_code=403, error_message="You do not have permission to access this page.", @@ -64,7 +64,7 @@ async def forbidden(e): @app.errorhandler(404) async def page_not_found(e): - return render_template( + return await render_template( "error.html", error_code=404, error_message="The page you are looking for does not exist.", @@ -74,7 +74,7 @@ async def page_not_found(e): @app.errorhandler(405) async def method_not_allowed(e): - return render_template( + return await render_template( "error.html", error_code=405, error_message="The method is not allowed for the requested URL.", @@ -83,7 +83,7 @@ async def method_not_allowed(e): @app.errorhandler(410) async def gone(e): - return render_template( + return await render_template( "error.html", error_code=410, error_message="This page is no longer available.", @@ -92,7 +92,7 @@ async def gone(e): @app.errorhandler(429) async def too_many_requests(e): - return render_template( + return await render_template( "error.html", error_code=429, error_message="You have made too many requests.", @@ -101,7 +101,7 @@ async def too_many_requests(e): @app.errorhandler(500) async def server_error(e): - return render_template( + return await render_template( "error.html", error_code=500, error_message="An internal server error has occurred.", @@ -152,7 +152,7 @@ from quart import current_app as app @app.route("/example--resources") async def example_route(): - return await "From the [app_root]/resources/routes/routes.py file" + return "From the [app_root]/resources/routes/routes.py file" """ @@ -163,6 +163,6 @@ from quart import render_template @app.route("/") -def index(): - return render_template("index.html") +async def index(): + return await render_template("index.html") """