#26778 closed Bug (fixed)
ModelSignal.connect() does not work when 'weak' is set to False and receiver is a local function
Reported by: | laevilgenius | Owned by: | Tim Graham |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.10 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Since #26642 there seems to be a regression. ModelSignal.connect doesn't take into account 'weak' argument.
Quick fix might look like this:
-
django/db/models/signals.py
a b class ModelSignal(Signal): 27 27 return partial_method(sender) 28 28 29 29 def connect(self, receiver, sender=None, weak=True, dispatch_uid=None, apps=None): 30 self._lazy_method(super(ModelSignal, self).connect, apps, receiver, sender, dispatch_uid=dispatch_uid)30 self._lazy_method(super(ModelSignal, self).connect, apps, receiver, sender, weak=weak, dispatch_uid=dispatch_uid) 31 31 32 32 def disconnect(self, receiver=None, sender=None, weak=None, dispatch_uid=None, apps=None): 33 33 if weak is not None:
Change History (4)
comment:1 by , 9 years ago
Needs tests: | set |
---|---|
Owner: | changed from | to
Severity: | Normal → Release blocker |
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
Version: | master → 1.10 |
comment:2 by , 9 years ago
Needs tests: | unset |
---|
Note:
See TracTickets
for help on using tickets.
PR