fix: add response_model, tighten overrides type annotation, add uuid import

Code review fixes for feature flags endpoint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-04-02 15:19:11 +00:00
parent a60c19b305
commit 6117a83b0b

View File

@@ -1,5 +1,6 @@
import secrets
import string
import uuid
from datetime import datetime, timezone, timedelta
from typing import Annotated
from fastapi import APIRouter, Depends, HTTPException, status, Request
@@ -721,7 +722,7 @@ async def verify_email(
return {"message": "Email verified successfully"}
@router.get("/me/feature-flags")
@router.get("/me/feature-flags", response_model=dict[str, bool])
async def get_my_feature_flags(
current_user: Annotated[User, Depends(get_current_active_user)],
db: Annotated[AsyncSession, Depends(get_db)],
@@ -755,7 +756,7 @@ async def get_my_feature_flags(
)
plan_defaults = {d.flag_id: d.enabled for d in defaults_result.scalars().all()}
overrides: dict = {}
overrides: dict[uuid.UUID, bool] = {}
if current_user.account_id:
overrides_result = await db.execute(
select(AccountFeatureOverride).where(