Browse Source

fix ImproperlyConfigured raised when django.db.backends.dummy used with django 1.6

j0hnsmith 11 years ago
parent
commit
a0010d0d70
1 changed files with 4 additions and 1 deletions
  1. 4 1
      celery/fixups/django.py

+ 4 - 1
celery/fixups/django.py

@@ -178,7 +178,10 @@ class DjangoFixup(object):
         try:
             funs = [conn.close for conn in self._db.connections]
         except AttributeError:
-            funs = [self._db.close_connection]  # pre multidb
+            if hasattr(self._db, 'close_old_connections'):  # django 1.6
+                funs = [self._db.close_old_connections]
+            else:
+                funs = [self._db.close_connection]  # pre multidb, pending deprication in django 1.6
 
         for close in funs:
             try: