mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Type the requester-email extraction cleanly 🟪
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
b6746cc24a
commit
e4f14ed883
1 changed files with 2 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue