def error(self, **kwargs):
    assert (self.instance.status != self.instance.STATUS_DONE)
    self.instance.status = self.instance.STATUS_ERROR
    self.instance.finished_at = timezone.now()
    self.instance.modified_by = kwargs.get('user', None)
    self.instance.save()
def error(self, **kwargs):
    assert (self.instance.status != self.instance.STATUS_DONE)
    self.instance.status = self.instance.STATUS_ERROR
    self.instance.finished_at = timezone.now()
    self.instance.modified_by = kwargs.get('user', None)
    self.instance.save()