From 09b6d1c004d9bdcdd280223a22ec3d0f22c18d2d Mon Sep 17 00:00:00 2001 From: CI Bot Date: Wed, 15 Jul 2026 11:43:28 +0800 Subject: [PATCH] =?UTF-8?q?style:=20black=20=E6=A0=BC=E5=BC=8F=E5=8C=96=20?= =?UTF-8?q?B904=20=E4=BF=AE=E5=A4=8D=E5=90=8E=E7=9A=84=20raise=20from=20?= =?UTF-8?q?=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/api/app/api/routes/duplication.py | 4 +++- apps/api/app/api/routes/edit_plans_generation.py | 4 +--- apps/api/app/api/routes/feature_flags.py | 2 +- apps/api/app/api/routes/generation_tasks.py | 1 + apps/api/app/api/routes/templates.py | 4 +++- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/api/app/api/routes/duplication.py b/apps/api/app/api/routes/duplication.py index 126f3c09b..48eb3c92d 100644 --- a/apps/api/app/api/routes/duplication.py +++ b/apps/api/app/api/routes/duplication.py @@ -239,7 +239,9 @@ def get_duplication_detail( return _to_detail_response(record) -@router.delete("/records/{record_id}", status_code=status.HTTP_204_NO_CONTENT, response_model=None, response_class=Response) +@router.delete( + "/records/{record_id}", status_code=status.HTTP_204_NO_CONTENT, response_model=None, response_class=Response +) def delete_duplication_record( record_id: str, authenticated_user: AuthenticatedUser = Depends(get_current_user), diff --git a/apps/api/app/api/routes/edit_plans_generation.py b/apps/api/app/api/routes/edit_plans_generation.py index 72ef8d99f..1fb37412b 100644 --- a/apps/api/app/api/routes/edit_plans_generation.py +++ b/apps/api/app/api/routes/edit_plans_generation.py @@ -183,9 +183,7 @@ def _auto_fallback_auto_material_mode( def _check_queue_limits(gen_task_repo, user_id: str) -> None: """队列限流预检查""" try: - has_count = hasattr(gen_task_repo, "count_pending_by_user") and hasattr( - gen_task_repo, "count_pending_total" - ) + has_count = hasattr(gen_task_repo, "count_pending_by_user") and hasattr(gen_task_repo, "count_pending_total") if has_count: user_pending = gen_task_repo.count_pending_by_user(user_id) global_pending = gen_task_repo.count_pending_total() diff --git a/apps/api/app/api/routes/feature_flags.py b/apps/api/app/api/routes/feature_flags.py index ca059be11..c5834a5a6 100755 --- a/apps/api/app/api/routes/feature_flags.py +++ b/apps/api/app/api/routes/feature_flags.py @@ -178,7 +178,7 @@ async def delete_feature_flag( name: str, _: bool = Depends(_verify_internal_api_key), store: RedisFeatureFlagStore = Depends(_get_feature_flag_store), -) : +): """删除 Feature Flag。 只允许删除 ALLOWED_FLAGS 列表中的 flag。 diff --git a/apps/api/app/api/routes/generation_tasks.py b/apps/api/app/api/routes/generation_tasks.py index 7c18d2711..7f7b3fa60 100644 --- a/apps/api/app/api/routes/generation_tasks.py +++ b/apps/api/app/api/routes/generation_tasks.py @@ -43,6 +43,7 @@ logger = logging.getLogger(__name__) router = APIRouter() + def _to_generation_task_response(task) -> GenerationTaskResponse: return GenerationTaskResponse( id=task.id, diff --git a/apps/api/app/api/routes/templates.py b/apps/api/app/api/routes/templates.py index 5d26bc990..3f632d4d5 100644 --- a/apps/api/app/api/routes/templates.py +++ b/apps/api/app/api/routes/templates.py @@ -375,7 +375,9 @@ def create_category( ) -@router.delete("/categories/{category_id}", status_code=status.HTTP_204_NO_CONTENT, response_model=None, response_class=Response) +@router.delete( + "/categories/{category_id}", status_code=status.HTTP_204_NO_CONTENT, response_model=None, response_class=Response +) def delete_category( category_id: str, authenticated_user: AuthenticatedUser = Depends(get_current_user),