#31981: many_to_many add() does not trigger post_save signal for the through
class
-------------------------------------+-------------------------------------
Reporter: Kurt Wheeler | Owner: nobody
Type: Uncategorized | Status: closed
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):
* status: new => closed
* resolution: => invalid
* component: Uncategorized => Database layer (models, ORM)
Comment:
> In a branch I am working on, I am adding a post-save signal to
OrganizationUserAssociation. What I have found is that this isn't called
when `organization.members.add(user)` is called.
Yes because `.add()` doesn't call `save()` on
`OrganizationUserAssociation` instances, this is a bulk operation. You
should use the [https://docs.djangoproject.com/en/3.1/ref/signals/#m2m-
changed m2m_changed] signal.
Closing per TicketClosingReasons/UseSupportChannels.
--
Ticket URL: <https://code.djangoproject.com/ticket/31981#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/069.b8fad4452783d939076f1131679fe29a%40djangoproject.com.