Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #12718 -- Tighten up the error handling when loading database r…

…outers. Thanks to Jeff Balogh for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12336 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0cdd36fac857d19105e3872364147a5cebd45513 1 parent 7856a75
Russell Keith-Magee authored January 28, 2010

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

  1. 5  django/db/utils.py
5  django/db/utils.py
@@ -95,11 +95,12 @@ def __init__(self, routers):
95 95
                 try:
96 96
                     module_name, klass_name = r.rsplit('.', 1)
97 97
                     module = import_module(module_name)
98  
-                    router = getattr(module, klass_name)()
99 98
                 except ImportError, e:
100 99
                     raise ImproperlyConfigured('Error importing database router %s: "%s"' % (klass_name, e))
  100
+                try:
  101
+                    router = getattr(module, klass_name)()
101 102
                 except AttributeError:
102  
-                    raise ImproperlyConfigured('Module "%s" does not define a "%s" database router' % (module, klass_name))
  103
+                    raise ImproperlyConfigured('Module "%s" does not define a database router name "%s"' % (module, klass_name))
103 104
             else:
104 105
                 router = r
105 106
             self.routers.append(router)

0 notes on commit 0cdd36f

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