Skip to content

Commit

Permalink
Fix many to many async set
Browse files Browse the repository at this point in the history
  • Loading branch information
Vonfry committed Sep 14, 2024
1 parent 226e2f0 commit c1ba5e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adrf/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ async def acreate(self, validated_data):
if many_to_many:
for field_name, value in many_to_many.items():
field = getattr(instance, field_name)
field.set(value)
await field.aset(value)

return instance

Expand All @@ -298,6 +298,6 @@ async def aupdate(self, instance, validated_data):
# updated instance and we do not want it to collide with .update()
for attr, value in m2m_fields:
field = getattr(instance, attr)
field.set(value)
await field.aset(value)

return instance

0 comments on commit c1ba5e1

Please sign in to comment.