Old description:
> Here's my setup:
>
>
> {{{
> class MyModel(models.Model):
> pass
>
> @receiver(post_save, sender=MyModel)
> @receiver(post_delete, sender=MyModel)
> def process_stuff(sender, instance, **kwargs):
> # to some magic
> pass
> }}}
>
> When I want to disconnect the post_save signal like this:
>
> {{{
> from django.db.models import signals
> signals.post_save.disconnect(
> receiver=process_stuff,
> sender=MyModel,
> }}}
>
> ... it does not work.
>
> If I comment out the second decorator with `post_delete`, it works.
>
> If I split this up and use two different functions, it works as well.
>
> I posted at StackOverflow (https://stackoverflow.com/q/64102708/1331671)
> and in some django groups, but no replies yet.
>
> Seems like a bug to me :(
New description:
Here's my setup on django 3.0.10:
{{{
class MyModel(models.Model):
pass
@receiver(post_save, sender=MyModel)
@receiver(post_delete, sender=MyModel)
def process_stuff(sender, instance, **kwargs):
# to some magic
pass
}}}
When I want to disconnect the post_save signal like this:
{{{
from django.db.models import signals
signals.post_save.disconnect(
receiver=process_stuff,
sender=MyModel,
}}}
... it does not work.
If I comment out the second decorator with `post_delete`, it works.
If I split this up and use two different functions, it works as well.
I posted at StackOverflow (https://stackoverflow.com/q/64102708/1331671)
and in some django groups, but no replies yet.
Seems like a bug to me :(
--
--
Ticket URL: <https://code.djangoproject.com/ticket/32054#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Ron):
Sure, I'll update my question accordingly. Thanks for your time so far!
--
Ticket URL: <https://code.djangoproject.com/ticket/32054#comment:5>