models.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:kobo 作者: release-engineering 项目源码 文件源码
def open_task(self, worker_id=None):
        """Open the task on a worker identified by worker_id."""
        if worker_id is None:
            worker_id = self.worker_id

        try:
            self.__lock(worker_id, new_state=TASK_STATES["OPEN"], initial_states=(TASK_STATES["FREE"], TASK_STATES["ASSIGNED"]))
        except (MultipleObjectsReturned, ObjectDoesNotExist):
            raise Exception("Cannot open task %d, state is %s" % (self.id, self.get_state_display()))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号