fix: DELETE 204路由改用response_model=None并移除return None,彻底解决FastAPI断言错误
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 15s
CI/CD Pipeline / Unit Tests (push) Failing after 11s
CI/CD Pipeline / Integration Tests (push) Failing after 5s
CI/CD Pipeline / Frontend Lint (push) Failing after 2m13s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Failing after 1552h27m50s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1552h27m49s
CI/CD Pipeline / Deploy Production (push) Failing after 1552h59m23s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1552h27m47s
CI/CD Pipeline / Staging API Integration Tests (push) Failing after 1552h27m48s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1552h27m48s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 15s
CI/CD Pipeline / Unit Tests (push) Failing after 11s
CI/CD Pipeline / Integration Tests (push) Failing after 5s
CI/CD Pipeline / Frontend Lint (push) Failing after 2m13s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Failing after 1552h27m50s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1552h27m49s
CI/CD Pipeline / Deploy Production (push) Failing after 1552h59m23s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1552h27m47s
CI/CD Pipeline / Staging API Integration Tests (push) Failing after 1552h27m48s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1552h27m48s
This commit is contained in:
@@ -173,12 +173,12 @@ async def update_feature_flag(
|
||||
raise HTTPException(status_code=500, detail=f"Failed to update flag: {exc}")
|
||||
|
||||
|
||||
@router.delete("/{name}", status_code=status.HTTP_204_NO_CONTENT, response_class=Response)
|
||||
@router.delete("/{name}", status_code=status.HTTP_204_NO_CONTENT, response_model=None)
|
||||
async def delete_feature_flag(
|
||||
name: str,
|
||||
_: bool = Depends(_verify_internal_api_key),
|
||||
store: RedisFeatureFlagStore = Depends(_get_feature_flag_store),
|
||||
) -> None:
|
||||
) :
|
||||
"""删除 Feature Flag。
|
||||
|
||||
只允许删除 ALLOWED_FLAGS 列表中的 flag。
|
||||
@@ -188,7 +188,7 @@ async def delete_feature_flag(
|
||||
try:
|
||||
deleted = store.delete(name)
|
||||
logger.info("Feature flag deleted: name=%s deleted=%s", name, deleted)
|
||||
return None
|
||||
pass
|
||||
except Exception as exc:
|
||||
logger.error("Failed to delete feature flag %s: %s", name, exc)
|
||||
raise HTTPException(status_code=500, detail=f"Failed to delete flag: {exc}")
|
||||
|
||||
Reference in New Issue
Block a user