Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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: http://code.djangoproject.com/svn/django/trunk@8186 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit e608433ee76080a18f177f6e18a11de624d3f03d 1 parent 2db4b13
Brian Rosner authored August 01, 2008

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  django/contrib/admin/__init__.py
6  django/contrib/admin/__init__.py
@@ -11,6 +11,8 @@ def autodiscover():
11 11
     from django.conf import settings
12 12
     for app in settings.INSTALLED_APPS:
13 13
         try:
14  
-            __import__("%s.admin" % app)
  14
+            imp.find_module("admin", __import__(app, fromlist=[app.split(".")[-1]]).__path__)
15 15
         except ImportError:
16  
-            pass
  16
+            # there is no app admin.py, skip it
  17
+            continue
  18
+        __import__("%s.admin" % app)

0 notes on commit e608433

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