Commit 515b4d3a authored by Russell Keith-Magee's avatar Russell Keith-Magee
Browse files

Fixed #14381 -- Clarified exception handling when instantiating Routers....

Fixed #14381 -- Clarified exception handling when instantiating Routers. Thanks to dauerbaustelle for the suggestion and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14005 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent f53491db
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -111,9 +111,11 @@ class ConnectionRouter(object):
                except ImportError, e:
                    raise ImproperlyConfigured('Error importing database router %s: "%s"' % (klass_name, e))
                try:
                    router = getattr(module, klass_name)()
                    router_class = getattr(module, klass_name)
                except AttributeError:
                    raise ImproperlyConfigured('Module "%s" does not define a database router name "%s"' % (module, klass_name))
                else:
                    router = router_class()
            else:
                router = r
            self.routers.append(router)