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

Function api_task_user_remove

default/methods/task/task/task_user_remove.py:8–38  ·  view source on GitHub ↗
(project_string_id, task_id)

Source from the content-addressed store, hash-verified

6@routes.route('/api/v1/project/<string:project_string_id>/task/<int:task_id>/user/remove', methods = ['POST'])
7@Project_permissions.user_has_project(Roles = ["admin", "Editor"], apis_user_list = ["api_enabled_builder"])
8def api_task_user_remove(project_string_id, task_id):
9 with sessionMaker.session_scope() as session:
10 spec_list = [
11 {'user_id_list': {
12 'required': False,
13 }},
14 {'relation': {
15 'required': True,
16 'kind': str,
17 'valid_values_list': ['reviewer', 'assignee']
18 }},
19 ]
20
21 log, input, untrusted_input = regular_input.master(request = request,
22 spec_list = spec_list)
23 if len(log["error"].keys()) >= 1:
24 return jsonify(log = log), 400
25
26 result, log = task_user_remove_core(
27 session = session,
28 task_id = task_id,
29 user_id_list = input['user_id_list'],
30 relation = input['relation'],
31 project_string_id = project_string_id,
32 log = log
33 )
34
35 if len(log["error"].keys()) >= 1:
36 return jsonify(log = log), 400
37
38 return jsonify(removed = result, log = log)
39
40
41def task_user_remove_core(session: 'Session',

Callers

nothing calls this directly

Calls 1

task_user_remove_coreFunction · 0.70

Tested by

no test coverage detected