def task_in_json(taskid):
if ':' not in taskid:
return json.jsonify({'code': 400, 'error': 'bad project:task_id format'})
project, taskid = taskid.split(':', 1)
taskdb = app.config['taskdb']
task = taskdb.get_task(project, taskid)
if not task:
return json.jsonify({'code': 404, 'error': 'not found'})
task['status_string'] = app.config['taskdb'].status_to_string(task['status'])
return json.jsonify(task)
评论列表
文章目录