def finish(self, **kwargs):
    super(EndActivity, self).finish(**kwargs)
    update_fields = []
    if (not self.process.finished_at):
        self.process.finished_at = self.instance.finished_at
        update_fields.append('finished_at')
    if (not (self.process.status == self.process.STATUS_DONE)):
        self.process.status = self.process.STATUS_DONE
        update_fields.append('status')
    self.process.save(update_fields=update_fields)
def finish(self, **kwargs):
    super(EndActivity, self).finish(**kwargs)
    update_fields = []
    if (not self.process.finished_at):
        self.process.finished_at = self.instance.finished_at
        update_fields.append('finished_at')
    if (not (self.process.status == self.process.STATUS_DONE)):
        self.process.status = self.process.STATUS_DONE
        update_fields.append('status')
    self.process.save(update_fields=update_fields)