Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #14381 -- Clarified exception handling when instantiating Route…

…rs. Thanks to dauerbaustelle for the suggestion and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14005 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 515b4d3aa82c6a6dcc5ac749b10434bafd6b646b 1 parent f53491d
Russell Keith-Magee authored

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

  1. 4  django/db/utils.py
4  django/db/utils.py
@@ -111,9 +111,11 @@ def __init__(self, routers):
111 111
                 except ImportError, e:
112 112
                     raise ImproperlyConfigured('Error importing database router %s: "%s"' % (klass_name, e))
113 113
                 try:
114  
-                    router = getattr(module, klass_name)()
  114
+                    router_class = getattr(module, klass_name)
115 115
                 except AttributeError:
116 116
                     raise ImproperlyConfigured('Module "%s" does not define a database router name "%s"' % (module, klass_name))
  117
+                else:
  118
+                    router = router_class()
117 119
             else:
118 120
                 router = r
119 121
             self.routers.append(router)

0 notes on commit 515b4d3

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