Type the requester-email extraction cleanly 🟪

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-08 10:05:11 +00:00
parent b6746cc24a
commit e4f14ed883

View file

@ -49,9 +49,9 @@ def get_requesting_user_email(user: Any = Depends(validate_jwt_token)) -> str:
ADR-0059: the route resolves the user (JWT ``dbId`` -> ``UserModel``) rather
than only gating the token, and threads the email into the job."""
email = getattr(user, "email", None)
email: Any = getattr(user, "email", None)
if email is None and isinstance(user, dict):
email = user.get("email")
email = cast(dict[str, Any], user).get("email")
if not email:
raise HTTPException(
status_code=400,