Skip to content

Commit

Permalink
2171 (#2178)
Browse files Browse the repository at this point in the history
* setting current phase on deactivate/activate phases

* fix for post actions
  • Loading branch information
dinesh-aot authored Apr 30, 2024
1 parent 4786d08 commit 40a7cfb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion epictrack-api/src/api/services/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,10 @@ def _post_process_actions(cls, source_event: Event):
all_work_phases = sorted(all_work_phases, key=lambda x: x.sort_order)
work = source_event.work
# if it is same, no need to do unwanted update
if work.current_work_phase_id != all_work_phases[0].id:
if (
len(all_work_phases) > 0
and work.current_work_phase_id != all_work_phases[0].id
):
work.current_work_phase = all_work_phases[0]
work.update(work.as_dict(recursive=False), commit=False)

Expand Down

0 comments on commit 40a7cfb

Please sign in to comment.