瀏覽代碼

Fixes deep dicts in chain

Ask Solem 10 年之前
父節點
當前提交
230b1ff7cb
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      celery/canvas.py

+ 5 - 1
celery/canvas.py

@@ -468,7 +468,11 @@ class chain(Signature):
 
     @classmethod
     def from_dict(self, d, app=None):
-        return chain(*d['kwargs']['tasks'], app=app, **d['options'])
+        tasks = d['kwargs']['tasks']
+        if tasks:
+            # First task must be signature object to get app
+            tasks[0] = maybe_signature(tasks[0], app=app)
+        return chain(*tasks, app=app, **d['options'])
 
     @property
     def app(self):