Skip to content

Commit 9da50a7

Browse files
refactor: update serialization methods in CustomerProperty models to allow None return type
1 parent c55e088 commit 9da50a7

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎plane/models/customers.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ class CustomerProperty(BaseModel):
177177
options: list[CustomerPropertyOption] | None = None
178178

179179
@field_serializer("property_type")
180-
def serialize_property_type(self, value: PropertyType) -> str:
180+
def serialize_property_type(self, value: PropertyType) -> str | None:
181181
return value.value if value else None
182182

183183
@field_serializer("relation_type")
184-
def serialize_relation_type(self, value: RelationType) -> str:
184+
def serialize_relation_type(self, value: RelationType) -> str | None:
185185
return value.value if value else None
186186

187187

@@ -208,11 +208,11 @@ class CreateCustomerProperty(BaseModel):
208208
options: list[CreateCustomerPropertyOption] | None = None
209209

210210
@field_serializer("property_type")
211-
def serialize_property_type(self, value: PropertyType) -> str:
211+
def serialize_property_type(self, value: PropertyType) -> str | None:
212212
return value.value if value else None
213213

214214
@field_serializer("relation_type")
215-
def serialize_relation_type(self, value: RelationType) -> str:
215+
def serialize_relation_type(self, value: RelationType) -> str | None:
216216
return value.value if value else None
217217

218218
@model_validator(mode="after")
@@ -272,11 +272,11 @@ class UpdateCustomerProperty(BaseModel):
272272
options: list[UpdateCustomerPropertyOption] | None = None
273273

274274
@field_serializer("property_type")
275-
def serialize_property_type(self, value: PropertyType) -> str:
275+
def serialize_property_type(self, value: PropertyType) -> str | None:
276276
return value.value if value else None
277277

278278
@field_serializer("relation_type")
279-
def serialize_relation_type(self, value: RelationType) -> str:
279+
def serialize_relation_type(self, value: RelationType) -> str | None:
280280
return value.value if value else None
281281

282282
@model_validator(mode="after")

0 commit comments

Comments
 (0)