Browse Source

AbortableTask must use the request, and not depend on magic kwargs.

Closes #383
David Arthur 14 years ago
parent
commit
736361873e
2 changed files with 3 additions and 1 deletions
  1. 1 0
      AUTHORS
  2. 2 1
      celery/contrib/abortable.py

+ 1 - 0
AUTHORS

@@ -69,5 +69,6 @@ Ordered by date of first contribution:
   Marcin Kuźmiński <marcin@python-works.com>
   Adriano Petrich <petrich@gmail.com>
   David Strauss <david@davidstrauss.net>
+  David Arthur <mumrah@gmail.com>
   Miguel Hernandez Martos <enlavin@gmail.com>
   Jannis Leidel <jannis@leidel.info>

+ 2 - 1
celery/contrib/abortable.py

@@ -155,7 +155,8 @@ class AbortableTask(Task):
         often (for performance).
 
         """
-        result = self.AsyncResult(kwargs["task_id"])
+        task_id = kwargs.get('task_id', self.request.id)
+        result = self.AsyncResult(task_id)
         if not isinstance(result, AbortableAsyncResult):
             return False
         return result.is_aborted()