Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #7922 -- admin.autodiscover() no longer eats ImportErrors for b…

…reakfast. Thanks Jan Rademaker and Alex Gaynor for their work on the ticket.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8174 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 525e1e379af20e53819b3b34b27380eb27ca0ac8 1 parent be17a80
Brian Rosner authored August 01, 2008

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

  1. 7  django/contrib/admin/__init__.py
7  django/contrib/admin/__init__.py
@@ -8,9 +8,12 @@ def autodiscover():
8 8
     not present. This forces an import on them to register any admin bits they
9 9
     may want.
10 10
     """
  11
+    import imp
11 12
     from django.conf import settings
12 13
     for app in settings.INSTALLED_APPS:
13 14
         try:
14  
-            __import__("%s.admin" % app)
  15
+            imp.find_module("admin", app.split("."))
15 16
         except ImportError:
16  
-            pass
  17
+            # there is no admin.py in app, skip it.
  18
+            continue
  19
+        __import__("%s.admin" % app)

0 notes on commit 525e1e3

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