hotfix: 移除 delete 路由的 response_class=Response 修复 204 断言崩溃
Tests / lint (pull_request) Failing after 159h56m48s
Tests / test (pull_request) Failing after 159h56m48s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 159h57m21s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 159h57m26s
CI/CD Pipeline / Frontend Lint (push) Failing after 159h58m2s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 159h58m8s

FastAPI 不允许 status_code=204 同时指定 response_class=Response,
导致 API 容器启动时 AssertionError 不断重启。

修复 8 处 @router.delete 装饰器:
- duplication.py:242
- recipes.py:177
- templates.py:198, 276
- titles.py:146
- tts.py:179
- voice_clones.py:194
- voices.py:319
This commit is contained in:
灵应
2026-07-02 20:55:39 +08:00
parent 8b2ba8dc16
commit dd2808d17a
7 changed files with 7 additions and 8 deletions
+1 -1
View File
@@ -239,7 +239,7 @@ def get_duplication_detail(
return _to_detail_response(record)
@router.delete("/records/{record_id}", status_code=status.HTTP_204_NO_CONTENT, response_class=Response)
@router.delete("/records/{record_id}", status_code=status.HTTP_204_NO_CONTENT)
def delete_duplication_record(
record_id: str,
authenticated_user: AuthenticatedUser = Depends(get_current_user),
+1 -1
View File
@@ -174,7 +174,7 @@ def update_recipe(
return _to_response(recipe)
@router.delete("/{recipe_id}", status_code=status.HTTP_204_NO_CONTENT, response_class=Response)
@router.delete("/{recipe_id}", status_code=status.HTTP_204_NO_CONTENT)
def delete_recipe(
recipe_id: str,
authenticated_user: AuthenticatedUser = Depends(get_current_user),
+2 -2
View File
@@ -195,7 +195,7 @@ def update_template(
return _to_response(template)
@router.delete("/{template_id}", status_code=status.HTTP_204_NO_CONTENT, response_class=Response)
@router.delete("/{template_id}", status_code=status.HTTP_204_NO_CONTENT)
def delete_template(
template_id: str,
authenticated_user: AuthenticatedUser = Depends(get_current_user),
@@ -273,7 +273,7 @@ def create_category(
)
@router.delete("/categories/{category_id}", status_code=status.HTTP_204_NO_CONTENT, response_class=Response)
@router.delete("/categories/{category_id}", status_code=status.HTTP_204_NO_CONTENT)
def delete_category(
category_id: str,
authenticated_user: AuthenticatedUser = Depends(get_current_user),
+1 -1
View File
@@ -143,7 +143,7 @@ def update_title(
return _to_response(item)
@router.delete("/{title_id}", status_code=status.HTTP_204_NO_CONTENT, response_class=Response)
@router.delete("/{title_id}", status_code=status.HTTP_204_NO_CONTENT)
def delete_title(
title_id: str,
authenticated_user: AuthenticatedUser = Depends(get_current_user),
+1 -1
View File
@@ -176,7 +176,7 @@ def get_tts_job_status(
)
@router.delete("/jobs/{job_id}", status_code=status.HTTP_204_NO_CONTENT, response_class=Response)
@router.delete("/jobs/{job_id}", status_code=status.HTTP_204_NO_CONTENT)
def delete_tts_job(
job_id: str,
authenticated_user: AuthenticatedUser = Depends(get_current_user),
-1
View File
@@ -191,7 +191,6 @@ def get_voice_clone_status(
@router.delete(
"/{clone_id}",
status_code=status.HTTP_204_NO_CONTENT,
response_class=Response,
)
def delete_voice_clone(
clone_id: str,
+1 -1
View File
@@ -316,7 +316,7 @@ def update_voice(
return _to_response(item)
@router.delete("/{voice_id}", status_code=status.HTTP_204_NO_CONTENT, response_class=Response)
@router.delete("/{voice_id}", status_code=status.HTTP_204_NO_CONTENT)
def delete_voice(
voice_id: str,
authenticated_user: AuthenticatedUser = Depends(get_current_user),