Explorar o código

Catch AttributeError on missing "tasks" module

Ask Solem %!s(int64=15) %!d(string=hai) anos
pai
achega
2b72d6346f
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      celery/loaders/djangoapp.py

+ 4 - 1
celery/loaders/djangoapp.py

@@ -85,4 +85,7 @@ def find_related_module(app, related_name):
 
     module = importlib.import_module("%s.%s" % (app, related_name))
 
-    return getattr(module, related_name)
+    try:
+        return getattr(module, related_name)
+    except AttributeError:
+        return