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

Function api_by_task_is_complete_toggle

default/methods/annotation/flags.py:14–34  ·  view source on GitHub ↗
(task_id)

Source from the content-addressed store, hash-verified

12 methods=['POST'])
13@Permission_Task.by_task_id(apis_user_list=["builder_or_trainer"])
14def api_by_task_is_complete_toggle(task_id):
15 with sessionMaker.session_scope() as session:
16 task = Task.get_by_id(
17 session = session,
18 task_id = task_id)
19 file = task.file
20 new_file = file.toggle_flag_shared(session)
21
22 if new_file is False: return jsonify(False), 400
23
24 Event.new(
25 session = session,
26 kind = "file_complete_toggle",
27 member = get_member(session=session),
28 project_id = task.project_id,
29 file_id = file.id,
30 description = f"from_task_{str(file.ann_is_complete)}"
31 )
32
33 return jsonify( success = True,
34 new_file = new_file.serialize_with_type(session)), 200
35
36
37@routes.route('/api/project/<string:project_string_id>' +

Callers

nothing calls this directly

Calls 5

get_memberFunction · 0.85
toggle_flag_sharedMethod · 0.80
serialize_with_typeMethod · 0.80
get_by_idMethod · 0.45
newMethod · 0.45

Tested by

no test coverage detected