#21217 closed Cleanup/optimization (fixed)

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

Reported by: charettes Owned by: nobody
Component: Database layer (models, ORM) Version: master
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 charettes 19 months ago.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 19 months ago by timo

  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 19 months ago by Simon Charette <charette.s@…>

  • Resolution set to fixed
  • Status changed from new to closed

In 948d209adac566d89f44f073fdd77a371c18e269:

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

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