def schedule(self, **kwargs):
    self.instance.status = self.instance.STATUS_SCHEDULED
    self.instance.scheduled_at = timezone.now()
    self.instance.save()
    transaction.on_commit((lambda : run_async_activity.delay(self.flow.label, self.instance.pk)))
def schedule(self, **kwargs):
    self.instance.status = self.instance.STATUS_SCHEDULED
    self.instance.scheduled_at = timezone.now()
    self.instance.save()
    transaction.on_commit((lambda : run_async_activity.delay(self.flow.label, self.instance.pk)))