I believe the behaviour you're seeing is due to the fact that the admin view first has to save the instance of the model being edited, and only then can it save the related objects and relationships. So it is a two-step thing: https://github.com/django/django/blob/84609b3205905097d7d3038d32e6101f012c0619/django/contrib/admin/options.py#L1584-L1585
Not sure if it is a bug, though. Perhaps it can be documented (if it isn't). Something like "If you are overriding MyModel.save (or using post_save signal?), be aware that the admin <does what it does>..."? On Sunday, 27 September 2020 at 21:28:13 UTC+2 [email protected] wrote: > Methods associated with m2m (clear, set) fields do not work in the save () > method of the model using from the admin panel. > The error did not occur when instantiation or update was initiated from > other sources (wrapper, control command api) > > Details (test project with instructions to reproduction) here: > > https://github.com/Sibiryakanton/Django_bugcase > > > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" 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-developers/1c6ad952-0105-4c31-84b2-43afa6c8e126n%40googlegroups.com.
