From bc5fec7f02b36de1fc6d77fa340d3c80de17417c Mon Sep 17 00:00:00 2001 From: remyvdwereld <86827854+remyvdwereld@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:57:13 +0100 Subject: [PATCH] caseState change in task_nakijken_aanschrijving --- app/apps/workflow/user_tasks.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/apps/workflow/user_tasks.py b/app/apps/workflow/user_tasks.py index f440c1879..e008ae78d 100644 --- a/app/apps/workflow/user_tasks.py +++ b/app/apps/workflow/user_tasks.py @@ -304,6 +304,17 @@ 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"""