Ticket #14381: django-14381.diff

File django-14381.diff, 808 bytes (added by Alex, 5 years ago)

Turned it into a diff.

  • django/db/utils.py

    diff --git a/django/db/utils.py b/django/db/utils.py
    index 00b3568..7c3e413 100644
    a b class ConnectionRouter(object): 
    111111                except ImportError, e:
    112112                    raise ImproperlyConfigured('Error importing database router %s: "%s"' % (klass_name, e))
    113113                try:
    114                     router = getattr(module, klass_name)()
     114                    router_class = getattr(module, klass_name)
    115115                except AttributeError:
    116116                    raise ImproperlyConfigured('Module "%s" does not define a database router name "%s"' % (module, klass_name))
     117                else:
     118                    router = router_class()
    117119            else:
    118120                router = r
    119121            self.routers.append(router)
Back to Top