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

Function api_task_complete

default/methods/task/task/task_complete.py:8–32  ·  view source on GitHub ↗

(task_id)

Source from the content-addressed store, hash-verified

6@routes.route('/api/v1/task/<int:task_id>/complete', methods = ['POST'])
7@Permission_Task.by_task_id(apis_user_list = ["builder_or_trainer"])
8def api_task_complete(task_id):
9 """
10
11 """
12 spec_list = []
13
14 log, input, untrusted_input = regular_input.master(request = request,
15 spec_list = spec_list)
16 if len(log["error"].keys()) >= 1:
17 return jsonify(log = log), 400
18
19 with sessionMaker.session_scope() as session:
20 member = get_member(session = session)
21
22 task_serialized = task_complete_core(session = session,
23 task_id = task_id,
24 member = member)
25
26 if task_serialized is False:
27 log['info']['task'] = "No Task Found"
28 return jsonify(log = log), 200
29
30 log['success'] = True
31 return jsonify(log = log,
32 task = task_serialized), 200
33
34
35def task_complete_core(session,

Callers

nothing calls this directly

Calls 2

get_memberFunction · 0.85
task_complete_coreFunction · 0.85

Tested by

no test coverage detected