Skip to content
Browse files

Pass the correct data as the second parameter to find_module to corre…

…ct admin.autodiscover(). Fixes #7922. Thanks Alex Gaynor for being smarter than me.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 2db4b13 commit e608433ee76080a18f177f6e18a11de624d3f03d @brosner brosner committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 django/contrib/admin/
6 django/contrib/admin/
@@ -11,6 +11,8 @@ def autodiscover():
from django.conf import settings
for app in settings.INSTALLED_APPS:
- __import__("%s.admin" % app)
+ imp.find_module("admin", __import__(app, fromlist=[app.split(".")[-1]]).__path__)
except ImportError:
- pass
+ # there is no app, skip it
+ continue
+ __import__("%s.admin" % app)

0 comments on commit e608433

Please sign in to comment.
Something went wrong with that request. Please try again.