diff --git a/api/ask_astro/models/request.py b/api/ask_astro/models/request.py index 97f79b7c..06be7f83 100644 --- a/api/ask_astro/models/request.py +++ b/api/ask_astro/models/request.py @@ -57,7 +57,7 @@ class AskAstroRequest(BaseModel): False, description="Whether the request is an example", ) - client: str = Field(None, description="The client type used to send the request -- webapp/slack") + client: str | None = Field(None, description="The client type used to send the request -- webapp/slack") def to_firestore(self) -> dict[str, Any]: """ @@ -107,7 +107,7 @@ def from_dict(cls, response_dict: dict[str, Any]) -> AskAstroRequest: response_received_at=response_dict.get("response_received_at"), is_processed=response_dict.get("is_processed", False), is_example=response_dict.get("is_example", False), - client=response_dict["client"], + client=response_dict.get("client", None), )