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

Function task_user_remove_core

default/methods/task/task/task_user_modify.py:102–119  ·  view source on GitHub ↗
(session: 'Session',
                          task_user_id: int,
                          project_string_id: str,
                          log: dict)

Source from the content-addressed store, hash-verified

100
101
102def task_user_remove_core(session: 'Session',
103 task_user_id: int,
104 project_string_id: str,
105 log: dict):
106 project = Project.get_by_string_id(session, project_string_id = project_string_id)
107
108 task_user = TaskUser.get_by_id(session = session, task_user_id = task_user_id)
109
110 if task_user.task.project_id != project.id:
111 log['error']['project_id'] = 'Project and TaskUser mismatch. TaskUser does not belong to project.'
112 return False, log
113
114 if task_user:
115 session.delete(task_user)
116 return True, log
117 else:
118 log['error']['task_user'] = 'Cannot find given task user relation'
119 return False, log

Callers 1

task_user_modify_coreFunction · 0.70

Calls 3

get_by_string_idMethod · 0.45
get_by_idMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected