def undo(self, **kwargs):
    assert (self.instance.status == self.instance.STATUS_DONE)
    self.instance.finished_at = None
    self.instance.status = self.instance.STATUS_INSTANTIATED
    self.instance.modified_by = kwargs.get('user', None)
    self.instance.save()
    undo_callback = getattr(self.process, 'undo_{}'.format(self.name), None)
    if (undo_callback is not None):
        undo_callback()
def undo(self, **kwargs):
    assert (self.instance.status == self.instance.STATUS_DONE)
    self.instance.finished_at = None
    self.instance.status = self.instance.STATUS_INSTANTIATED
    self.instance.modified_by = kwargs.get('user', None)
    self.instance.save()
    undo_callback = getattr(self.process, 'undo_{}'.format(self.name), None)
    if (undo_callback is not None):
        undo_callback()