Skip to content

Commit

Permalink
fix do not use id from client to create obj
Browse files Browse the repository at this point in the history
  • Loading branch information
mstingl committed May 8, 2024
1 parent 0b4af2b commit 77058d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions djdantic/utils/pydantic_django/pydantic_to_django.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,7 @@ def get_subobj_rev_many_to_one(
force_create = True

if force_create or action == TransferAction.CREATE:
create_fields = {}
if getattr(val, 'id', None):
create_fields['id'] = getattr(val, 'id', None)

return related_model(**obj_fields, **create_fields)
return related_model(**obj_fields)

elif action == TransferAction.SYNC:
try:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = djdantic
version = 0.0.26b6
version = 0.0.26b7
author = Manuel Stingl
author_email = opensource@voltane.eu
description = Utilities to use pydantic with the django orm
Expand Down

0 comments on commit 77058d4

Please sign in to comment.