Update callback_data.py

This commit is contained in:
m-xim 2025-01-02 16:39:36 +03:00
parent 5a5ea473be
commit 0ebfe1aade

View file

@ -131,7 +131,7 @@ class CallbackData(BaseModel):
payload = {}
for k, v in zip(names, parts): # type: str, Optional[str]
if field := cls.model_fields.get(k):
if v == "" and _check_field_is_nullable(field):
if v == "" and _check_field_is_nullable(field) and field.default != "":
v = field.default if field.default is not PydanticUndefined else None
payload[k] = v
return cls(**payload)