def cancel(self, **kwargs):
    assert (self.instance.status in (self.instance.STATUS_INSTANTIATED, self.instance.STATUS_ERROR))
    self.instance.status = self.instance.STATUS_CANCELED
    self.instance.modified_by = kwargs.get('user', None)
    self.instance.save()
def cancel(self, **kwargs):
    assert (self.instance.status in (self.instance.STATUS_INSTANTIATED, self.instance.STATUS_ERROR))
    self.instance.status = self.instance.STATUS_CANCELED
    self.instance.modified_by = kwargs.get('user', None)
    self.instance.save()