From 747550fca246d9d1babadfdc01b370bcee48d57a Mon Sep 17 00:00:00 2001 From: remyvdwereld <86827854+remyvdwereld@users.noreply.github.com> Date: Thu, 7 Dec 2023 15:56:41 +0100 Subject: [PATCH] Added status --- app/apps/cases/models.py | 2 +- .../default/unoccupied/7.1.0/unoccupied.bpmn | 2 +- app/apps/workflow/user_tasks.py | 22 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/apps/cases/models.py b/app/apps/cases/models.py index 31688f262..4fec856ca 100644 --- a/app/apps/cases/models.py +++ b/app/apps/cases/models.py @@ -221,7 +221,7 @@ def get_workflows(self): def get_state(self): # Return last added case_state - casestates = self.case_states.all().order_by("last_updated").last() + casestates = self.case_states.all().order_by("created").last() if casestates: return casestates.status else: diff --git a/app/apps/workflow/bpmn_files/default/unoccupied/7.1.0/unoccupied.bpmn b/app/apps/workflow/bpmn_files/default/unoccupied/7.1.0/unoccupied.bpmn index 71ba605e6..f687ca2db 100644 --- a/app/apps/workflow/bpmn_files/default/unoccupied/7.1.0/unoccupied.bpmn +++ b/app/apps/workflow/bpmn_files/default/unoccupied/7.1.0/unoccupied.bpmn @@ -102,8 +102,8 @@ - + diff --git a/app/apps/workflow/user_tasks.py b/app/apps/workflow/user_tasks.py index e008ae78d..d5936d892 100644 --- a/app/apps/workflow/user_tasks.py +++ b/app/apps/workflow/user_tasks.py @@ -304,17 +304,6 @@ class task_nakijken_aanschrijving(user_task): _task_name = "task_check_summons" due_date = relativedelta(weeks=1) - # It's possible to bypass task_opstellen_concept_aanschrijving for theme Leegstand. - # Create the CaseState HANDHAVING if it doesn't exist. Otherwise, the status TOEZICHT is retained. - def instance_created(self): - from apps.cases.models import CaseState - - CaseState.objects.get_or_create( - case=self.case_user_task.case, - status=CaseState.CaseStateChoice.HANDHAVING, - ) - return - class task_afzien_concept_aanschrijving(user_task): """Afzien concept aanschrijving""" @@ -677,6 +666,17 @@ class task_leegstand_opstellen_beeldverslag(user_task): class task_opstellen_leegstandsbeschikking(user_task): due_date = relativedelta(days=7) + # It's possible to bypass task_opstellen_concept_aanschrijving for theme Leegstand. + # Create the CaseState HANDHAVING if it doesn't exist. Otherwise, the status TOEZICHT is retained. + def instance_created(self): + from apps.cases.models import CaseState + + CaseState.objects.get_or_create( + case=self.case_user_task.case, + status=CaseState.CaseStateChoice.HANDHAVING, + ) + return + class task_opstellen_constateringsbrief(user_task): due_date = relativedelta(days=7)