Browse Source

subtask: Merge addititional keyword args to subtask() into task kwargs. Closes #182. Thanks to dfdeshom.

Ask Solem 14 years ago
parent
commit
cf5f8e1035
1 changed files with 3 additions and 2 deletions
  1. 3 2
      celery/task/sets.py

+ 3 - 2
celery/task/sets.py

@@ -70,8 +70,9 @@ class subtask(AttributeDict):
         except AttributeError:
             task_name = task
 
-        init(task=task_name, args=tuple(args or ()), kwargs=kwargs or (),
-             options=options or ())
+        init(task=task_name, args=tuple(args or ()),
+                             kwargs=dict(kwargs, **extra) or {},
+                             options=options or {})
 
     def delay(self, *argmerge, **kwmerge):
         """Shortcut to ``apply_async(argmerge, kwargs)``."""