(session: 'Session',
task_user_id: int,
project_string_id: str,
log: dict)
| 100 | |
| 101 | |
| 102 | def 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 |
no test coverage detected