fix(membership): use 'or ""' to guard against null email/full_name
u.get("key", "") returns None when key exists with null value in MongoDB,
causing Pydantic ValidationError on MemberDetail.email/full_name: str → 500.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e52abca74b
commit
6588feedc7
1 changed files with 2 additions and 2 deletions
|
|
@ -124,8 +124,8 @@ async def list_org_members(
|
|||
MemberDetail(
|
||||
membership_id=str(doc["_id"]),
|
||||
user_id=doc.get("user_id", ""),
|
||||
email=u.get("email", ""),
|
||||
full_name=u.get("full_name", ""),
|
||||
email=u.get("email") or "",
|
||||
full_name=u.get("full_name") or "",
|
||||
role_in_org=role,
|
||||
created_at=doc.get("created_at"),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue