Opened 15 years ago

Closed 14 years ago

#10887 closed (fixed)

admin.autodiscover

Reported by: Luc Saffre Owned by: nobody
Component: contrib.admin Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In django/contrib/admin/__init__.py, I suggest to change the following code:

    try:
        app_path = import_module(app).__path__
    except AttributeError:
        continue

into:

    mod = import_module(app)
    try:
        app_path = mod.__path__
    except AttributeError:
        continue

Otherwise there is a probably not intended behaviour if one of my modules is buggy and raises itself an AttributeError.

Attachments (1)

10887.diff (635 bytes ) - added by Chris Beaven 15 years ago.

Download all attachments as: .zip

Change History (3)

by Chris Beaven, 15 years ago

Attachment: 10887.diff added

comment:1 by Chris Beaven, 15 years ago

Triage Stage: UnreviewedReady for checkin

Agreed

comment:2 by Adrian Holovaty, 14 years ago

Resolution: fixed
Status: newclosed

(In [12192]) Fixed #10887 -- Fixed a possible gotcha in admin.autodiscover() by moving import_module() outside the try/except. Thanks, lsaffre

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