Kaydet (Commit) e608433e authored tarafından Brian Rosner's avatar Brian Rosner

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

Pass the correct data as the second parameter to find_module to correct admin.autodiscover(). Fixes #7922. Thanks Alex Gaynor for being smarter than me.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8186 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 2db4b134
......@@ -11,6 +11,8 @@ def autodiscover():
from django.conf import settings
for app in settings.INSTALLED_APPS:
try:
__import__("%s.admin" % app)
imp.find_module("admin", __import__(app, fromlist=[app.split(".")[-1]]).__path__)
except ImportError:
pass
# there is no app admin.py, skip it
continue
__import__("%s.admin" % app)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment