- try:
- meta = TaskMeta.objects.get(task_id=self.task)
- assert meta.status in (u'PENDING', u'STARTED', u'SUCCESS', u'RETRY')
- except TaskMeta.DoesNotExist:
- # Might happen it's not yet there.
- pass
- except AssertionError:
+ if self.task.status not in (u'PENDING', u'STARTED', u'SUCCESS', u'RETRY'):