From 3f71c8ef2c16158fbf1e7c5d419f31e5f0fce4b0 Mon Sep 17 00:00:00 2001 From: Maximilian Haye Date: Thu, 22 Aug 2024 16:45:12 +0200 Subject: [PATCH] chore: remove now-unnecessary type ignores --- questionpy_server/web/_routes/_attempts.py | 6 +++--- questionpy_server/web/_routes/_files.py | 2 +- questionpy_server/web/_routes/_packages.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/questionpy_server/web/_routes/_attempts.py b/questionpy_server/web/_routes/_attempts.py index 0ec47eb..824d0c9 100644 --- a/questionpy_server/web/_routes/_attempts.py +++ b/questionpy_server/web/_routes/_attempts.py @@ -20,7 +20,7 @@ attempt_routes = web.RouteTableDef() -@attempt_routes.post(r"/packages/{package_hash:\w+}/attempt/start") # type: ignore[arg-type] +@attempt_routes.post(r"/packages/{package_hash:\w+}/attempt/start") @ensure_required_parts async def post_attempt_start( request: web.Request, package: Package, question_state: bytes, data: AttemptStartArguments @@ -35,7 +35,7 @@ async def post_attempt_start( return pydantic_json_response(data=attempt, status=201) -@attempt_routes.post(r"/packages/{package_hash:\w+}/attempt/view") # type: ignore[arg-type] +@attempt_routes.post(r"/packages/{package_hash:\w+}/attempt/view") @ensure_required_parts async def post_attempt_view( request: web.Request, package: Package, question_state: bytes, data: AttemptViewArguments @@ -56,7 +56,7 @@ async def post_attempt_view( return pydantic_json_response(data=attempt, status=201) -@attempt_routes.post(r"/packages/{package_hash:\w+}/attempt/score") # type: ignore[arg-type] +@attempt_routes.post(r"/packages/{package_hash:\w+}/attempt/score") @ensure_required_parts async def post_attempt_score( request: web.Request, package: Package, question_state: bytes, data: AttemptScoreArguments diff --git a/questionpy_server/web/_routes/_files.py b/questionpy_server/web/_routes/_files.py index 1446a15..3c2f295 100644 --- a/questionpy_server/web/_routes/_files.py +++ b/questionpy_server/web/_routes/_files.py @@ -17,7 +17,7 @@ file_routes = web.RouteTableDef() -@file_routes.post(r"/packages/{package_hash}/file/{namespace}/{short_name}/{path:static/.*}") # type: ignore[arg-type] +@file_routes.post(r"/packages/{package_hash}/file/{namespace}/{short_name}/{path:static/.*}") @ensure_package async def serve_static_file(request: web.Request, package: Package) -> web.Response: qpy_server = request.app[QPyServer.APP_KEY] diff --git a/questionpy_server/web/_routes/_packages.py b/questionpy_server/web/_routes/_packages.py index cf2bca6..b6f5dae 100644 --- a/questionpy_server/web/_routes/_packages.py +++ b/questionpy_server/web/_routes/_packages.py @@ -42,7 +42,7 @@ async def get_package(request: web.Request) -> web.Response: return pydantic_json_response(data=package.get_info()) -@package_routes.post(r"/packages/{package_hash:\w+}/options") # type: ignore[arg-type] +@package_routes.post(r"/packages/{package_hash:\w+}/options") @ensure_required_parts async def post_options( request: web.Request, package: Package, data: RequestBaseData, question_state: bytes | None = None @@ -60,7 +60,7 @@ async def post_options( return pydantic_json_response(data=QuestionEditFormResponse(definition=definition, form_data=form_data)) -@package_routes.post(r"/packages/{package_hash:\w+}/question") # type: ignore[arg-type] +@package_routes.post(r"/packages/{package_hash:\w+}/question") @ensure_required_parts async def post_question( request: web.Request, data: QuestionCreateArguments, package: Package, question_state: bytes | None = None @@ -83,7 +83,7 @@ async def post_question_migrate(_request: web.Request) -> web.Response: raise HTTPMethodNotAllowed(msg, "") -@package_routes.post(r"/package-extract-info") # type: ignore[arg-type] +@package_routes.post(r"/package-extract-info") @ensure_package async def package_extract_info(_request: web.Request, package: Package) -> web.Response: """Get package information."""