MCPcopy Index your code
hub / github.com/diffgram/diffgram / task_next

Function task_next

default/methods/task/task/task_next.py:8–35  ·  view source on GitHub ↗

(job_id)

Source from the content-addressed store, hash-verified

6# Assumption this is a view?
7@routes.route('/api/v1/job/<int:job_id>/next-task', methods=['POST'])
8def task_next(job_id):
9 """
10
11 """
12 spec_list = [{'task_id': {'type': int, 'required': False}},
13 {'project_string_id': str},
14 {'direction': str},
15 {'assign_to_user': bool}]
16
17 log, input, untrusted_input = regular_input.master(request=request,
18 spec_list=spec_list)
19 if len(log["error"].keys()) >= 1:
20 return jsonify(log=log), 400
21
22 with sessionMaker.session_scope() as session:
23 task_serialized = task_next_core(session=session,
24 project_string_id=input['project_string_id'],
25 job_id=job_id,
26 task_id=input['task_id'],
27 input=input)
28
29 if task_serialized is False:
30 log['info']['task'] = "No Task Found"
31 return jsonify(log=log), 200
32
33 log['success'] = True
34 return jsonify(log=log,
35 task=task_serialized), 200
36
37
38@Permission_Task.by_task_id(apis_user_list=["builder_or_trainer"])

Callers

nothing calls this directly

Calls 1

task_next_coreFunction · 0.85

Tested by

no test coverage detected