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

Function task_complete

shared/utils/task/task_complete.py:81–174  ·  view source on GitHub ↗

Also handles new_file here, so for example if the child tasks ditacte that we do a review afterwards, we don't flag the file as complete This solves the "complete" problem, since the file is not really complete till it's reviewed right? And presumably we are going to hide

(session,
                  task,
                  new_file,
                  project,
                  member,
                  post_review = False)

Source from the content-addressed store, hash-verified

79 return True
80
81def task_complete(session,
82 task,
83 new_file,
84 project,
85 member,
86 post_review = False):
87 """
88
89 Also handles new_file here,
90 so for example if the child tasks ditacte that we do a review afterwards,
91 we don't flag the file as complete
92
93 This solves the "complete" problem, since the file is not really complete till it's reviewed
94 right?
95 And presumably we are going to hide controls anyway if in a different status
96
97 """
98
99 # TODO prevent completion of already complete tasks?
100
101 # Check child tasks
102 # Should create the event listeners before changing status
103 trigger_sync_event = True
104
105 if task.status == 'complete':
106 return True, new_file
107
108 else:
109 job = task.job
110 task_update_manager = Task_Update(
111 session = session,
112 task = task,
113 member = member
114 )
115 if job.allow_reviews:
116 if post_review:
117 task_update_manager.status = TASK_STATUSES['complete']
118 task_update_manager.main()
119 else:
120 trigger_sync_event = send_to_review_randomly(
121 session = session,
122 task = task,
123 task_update_manager = task_update_manager
124 )
125 else:
126 task_update_manager.status = TASK_STATUSES['complete']
127 task_update_manager.main()
128
129 # Careful, this is only relevant for normal
130 # tasks, not exams?
131 if task.job_type == 'Normal' and job.file_handling == "isolation":
132 merge_task(session = session,
133 job = job,
134 task = task)
135
136 # this stuff could be applicable to exams and normal maybe
137 new_file = new_file.toggle_flag_shared(session)
138

Callers

nothing calls this directly

Calls 10

mainMethod · 0.95
Task_UpdateClass · 0.90
send_to_review_randomlyFunction · 0.85
merge_taskFunction · 0.85
task_complete_examFunction · 0.85
toggle_flag_sharedMethod · 0.80
update_job_statusMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected