fix for not saving related model in reverse rel

This commit is contained in:
collerek
2021-06-02 13:05:10 +02:00
parent 0254abcd6c
commit c8ca6edb22
5 changed files with 63 additions and 2 deletions

View File

@ -214,7 +214,7 @@ class RelationProxy(Generic[T], list):
setattr(self._owner, self.field_name, item)
else:
setattr(item, relation_name, self._owner)
await item.update()
await item.upsert()
await self._owner.signals.post_relation_add.send(
sender=self._owner.__class__,
instance=self._owner,