From 2d730198d986296ba798257d38467330b2660923 Mon Sep 17 00:00:00 2001 From: Apple Date: Mon, 1 Dec 2025 09:37:48 -0800 Subject: [PATCH] fix(citizens): Fix PublicCitizenSummary slug validation error - Made slug optional in PublicCitizenSummary model - Added fallback to agent id if public_slug is None --- services/city-service/models_city.py | 2 +- services/city-service/routes_city.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/city-service/models_city.py b/services/city-service/models_city.py index 3469bda9..41639aa6 100644 --- a/services/city-service/models_city.py +++ b/services/city-service/models_city.py @@ -358,7 +358,7 @@ class AgentSummary(BaseModel): class PublicCitizenSummary(BaseModel): - slug: str + slug: Optional[str] = None # Can be None if public_slug not set display_name: str public_title: Optional[str] = None public_tagline: Optional[str] = None diff --git a/services/city-service/routes_city.py b/services/city-service/routes_city.py index c9dc69c3..1ac77c0d 100644 --- a/services/city-service/routes_city.py +++ b/services/city-service/routes_city.py @@ -675,7 +675,7 @@ async def list_public_citizens( ) items.append(PublicCitizenSummary( - slug=citizen["public_slug"], + slug=citizen.get("public_slug") or citizen.get("id"), display_name=citizen["display_name"], public_title=citizen.get("public_title"), public_tagline=citizen.get("public_tagline"),