Opened 11 years ago

Closed 11 years ago

#21217 closed Cleanup/optimization (fixed)

`ImageField` and `GenericForeignKey` shouldn't connect `(pre|post)_init` signals to abstract senders

Reported by: Simon Charette Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Since (pre|post)_init is only sent by non abstract models (actually it is also sent when an abstract model is instantiated but one should not do that anyway) we should avoid polluting the associated signals registries with useless entries.

Attaching a patch with testcases making sure the changes didn't affect ImageField and GenericForeignKey inherited from abstract bases. The full test suite pass on Python 2.7 SQLite.

Attachments (1)

0001-Fixed-21217-Avoid-connecting-pre-post-_init-signals-.patch (12.0 KB ) - added by Simon Charette 11 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 by Tim Graham, 11 years ago

Triage Stage: UnreviewedReady for checkin

comment:2 by Simon Charette <charette.s@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 948d209adac566d89f44f073fdd77a371c18e269:

Fixed #21217 -- Avoid connecting (pre|post)_init signals to abstract senders.

Note: See TracTickets for help on using tickets.
Back to Top