Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14870 closed (fixed)

Do not catch all AttributeErrors in CustomRouter.allow_syncdb and friends

Reported by: Jonas H. Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Use hasattr instead.

Attachments (1)

router-hasattr.patch (2.2 KB) - added by Jonas H. 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by Jonas H.

Attachment: router-hasattr.patch added

comment:1 Changed 6 years ago by Alex Gaynor

Resolution: fixed
Status: newclosed

(In [14857]) Fixed #14870 -- don't catch AttributeErrors in database router methods, instead check that the method itself exists. Thanks to jonash for the patch.

comment:2 Changed 6 years ago by Alex Gaynor

(In [14858]) [1.2.X] Fixed #14870 -- don't catch AttributeErrors in database router methods, instead check that the method itself exists. Thanks to jonash for the patch. Backport of [14857].

comment:3 Changed 6 years ago by Ramiro Morales

(In [15201]) Enhanced tests for r14857 added in r15185. Refs #14870. Thanks Harm Geerts.

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