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...
1 parent 5bcaa45 commit 31eb0fbe3d16418cafd907e333207431dc49cdd0 @adrianholovaty adrianholovaty committed Jan 10, 2010
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 31eb0fb

Please sign in to comment.