#26778: ModelSignal.connect() does not work when 'weak' is set to False and
receiver is a local function
----------------------------------------------+--------------------
Reporter: laevilgenius | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
Since #26642 there seems to be a regression. '''ModelSignal.connect'''
doesn't take into account 'weak' argument.
Quick fix might look like this:
{{{
#!diff
--- a/django/db/models/signals.py
+++ b/django/db/models/signals.py
@@ -27,7 +27,7 @@ class ModelSignal(Signal):
return partial_method(sender)
def connect(self, receiver, sender=None, weak=True,
dispatch_uid=None, apps=None):
- self._lazy_method(super(ModelSignal, self).connect, apps,
receiver, sender, dispatch_uid=dispatch_uid)
+ self._lazy_method(super(ModelSignal, self).connect, apps,
receiver, sender, weak=weak, dispatch_uid=dispatch_uid)
def disconnect(self, receiver=None, sender=None, weak=None,
dispatch_uid=None, apps=None):
if weak is not None:
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26778>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/055.9f218c210a8307e9111f308bf7638306%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.