This commit is contained in:
50bytes.dev 2023-08-24 18:41:34 +03:00
parent f5fd8504b9
commit 45ab47266c

View File

@ -649,7 +649,10 @@ class SQLModel(BaseModel, metaclass=SQLModelMetaclass, registry=default_registry
# remove defaults so they don't get validated # remove defaults so they don't get validated
data = {} data = {}
for key, value in validated: for key, value in validated:
field = cls.model_fields[key] field = cls.model_fields.get(key)
if field is None:
continue
if ( if (
hasattr(field, "default") hasattr(field, "default")