Skip to content

Commit

Permalink
API: Serialize timedeltas as numbers
Browse files Browse the repository at this point in the history
The default has been changed in Pydantic V2.

Fixes: #929

Signed-off-by: Nils Philippsen <[email protected]>
  • Loading branch information
nphilipp committed Sep 28, 2023
1 parent 03f583d commit 23d14e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion duffy/api_models/tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TenantBase(BaseModel, ABC):
node_quota: Optional[Annotated[int, Field(gt=0)]] = None
session_lifetime: Optional[ConfigTimeDelta] = None
session_lifetime_max: Optional[ConfigTimeDelta] = None
model_config = ConfigDict(from_attributes=True)
model_config = ConfigDict(from_attributes=True, ser_json_timedelta="float")


class TenantCreateModel(TenantBase):
Expand Down

0 comments on commit 23d14e6

Please sign in to comment.