refactor: Update BaseInputMixin to validate input assignment
This commit is contained in:
parent
f17c55727d
commit
969deae5e1
1 changed files with 1 additions and 1 deletions
|
|
@ -76,7 +76,7 @@ class BaseInputMixin(BaseModel, validate_assignment=True):
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate_field_type(cls, v):
|
def validate_field_type(cls, v):
|
||||||
if v not in FieldTypes:
|
if v not in FieldTypes:
|
||||||
raise ValueError(f"field_type must be one of {FieldTypes}")
|
return FieldTypes.OTHER
|
||||||
return FieldTypes(v)
|
return FieldTypes(v)
|
||||||
|
|
||||||
@model_serializer(mode="wrap")
|
@model_serializer(mode="wrap")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue