Permalink
Browse files

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

Closes #383
  • Loading branch information...
1 parent a5cce0b commit 736361873eec9e413494d5e7150ebc3a07a430e1 @mumrah mumrah committed with ask Apr 16, 2011
Showing with 3 additions and 1 deletion.
  1. +1 −0 AUTHORS
  2. +2 −1 celery/contrib/abortable.py
View
@@ -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>
@@ -155,7 +155,8 @@ def is_aborted(self, **kwargs):
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()

0 comments on commit 7363618

Please sign in to comment.