瀏覽代碼

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

j0hnsmith 11 年之前
父節點
當前提交
a0010d0d70
共有 1 個文件被更改,包括 4 次插入1 次删除
  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: