Skip to content

Commit a9a6b60

Browse files
authored
Merge pull request #288 from Tatsh/update-exclude-unset-not-none
ModelService: in update(), exclude_unset instead of exclude_none
2 parents 0126893 + 4e5846e commit a9a6b60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ninja_extra/controllers/model/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async def create_async(self, schema: PydanticModel, **kwargs: t.Any) -> t.Any:
6767
return await sync_to_async(self.create, thread_sensitive=True)(schema, **kwargs)
6868

6969
def update(self, instance: Model, schema: PydanticModel, **kwargs: t.Any) -> t.Any:
70-
data = schema.model_dump(exclude_none=True)
70+
data = schema.model_dump(exclude_unset=True)
7171
data.update(kwargs)
7272
for attr, value in data.items():
7373
setattr(instance, attr, value)

0 commit comments

Comments
 (0)