Permalink
Browse files

Fixed #10887 -- Fixed a possible gotcha in admin.autodiscover() by mo…

…ving import_module() outside the try/except. Thanks, lsaffre

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12192 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
adrian
adrian committed Jan 10, 2010
1 parent 29003fc commit dd191b33064bae286ae8e6a38bcd5c2ee601782b
Showing with 2 additions and 1 deletion.
  1. +2 −1 django/contrib/admin/__init__.py
@@ -37,8 +37,9 @@ def autodiscover():
# should) bubble up, but a missing __path__ (which is legal, but weird)
# fails silently -- apps that do weird things with __path__ might
# need to roll their own admin registration.
+ mod = import_module(app)
try:
- app_path = import_module(app).__path__
+ app_path = mod.__path__
except AttributeError:
continue

0 comments on commit dd191b3

Please sign in to comment.