def set_status(self, new_status):
        if new_status == self.status:
            return
        if new_status not in self.available_statuses():
            raise exceptions.InvalidOrderStatus(
                _("'%(new_status)s' is not a valid status for order %(number)s"
                  " (current status: '%(status)s')")
                % {'new_status': new_status,
                   'number': self.number,
                   'status': self.status})
        self.status = new_status
        if new_status in self.cascade:
            for line in self.lines.all():
                line.status = self.cascade[self.status]
                line.save()
        self.save()
Will run the command in an AsyncCommandResult in its own thread.
dataset/ETHPy150Open django-oscar/django-oscar/src/oscar/apps/order/abstract_models.py/AbstractOrder.set_status--crossover with--dataset/ETHPy150Open openstack/ironic-python-agent/ironic_python_agent/extensions/base.py/async_command