Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NvdLaan committed Jan 6, 2025
1 parent 7eb3e17 commit 44b0051
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/apps/workflow/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ def start(self):
)
)

workflow = self._update_workflow(workflow)
self._update_db(workflow)
workflow = self.update_workflow(workflow)
return

def complete_user_task_and_create_new_user_tasks(self, task_id=None, data=None):
Expand All @@ -117,7 +116,7 @@ def complete_user_task_and_create_new_user_tasks(self, task_id=None, data=None):
task.set_data(**data)
task.complete()

workflow = self._update_workflow(workflow)
workflow = self.update_workflow(workflow)
self._update_db(workflow)

def has_a_timer_event_fired(self):
Expand Down Expand Up @@ -264,9 +263,10 @@ def _initial_data(self, wf, data):
first_task.data.update(data)
return wf

def _update_workflow(self, wf):
def update_workflow(self, wf):
wf.refresh_waiting_tasks()
wf.do_engine_steps()
self._update_db(wf)
return wf

def _update_db(self, wf):
Expand Down
2 changes: 1 addition & 1 deletion app/apps/workflow/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def task_update_workflow(self, workflow_id):

workflow_instance = CaseWorkflow.objects.get(id=workflow_id)
with transaction.atomic():
workflow_instance._update_workflow(
workflow_instance.update_workflow(
workflow_instance._get_or_restore_workflow_state()
)
return (
Expand Down

0 comments on commit 44b0051

Please sign in to comment.