Skip to content

Commit

Permalink
Added status
Browse files Browse the repository at this point in the history
  • Loading branch information
remyvdwereld committed Dec 7, 2023
1 parent bc5fec7 commit 747550f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/apps/cases/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
<bpmn:extensionElements>
<camunda:formData>
<camunda:formField id="leegstandsgesprek_ingeplanned" label="Is er een afspraak gemaakt?" type="enum">
<camunda:value id="geen_afspraak_ingeplanned" name="Nee, geen afspraak kunnen inplannen" />
<camunda:value id="afspraak_ingeplanned" name="Ja, afspraak kunnen inplannen" />
<camunda:value id="geen_afspraak_ingeplanned" name="Nee, geen afspraak kunnen inplannen" />
</camunda:formField>
</camunda:formData>
</bpmn:extensionElements>
Expand Down
22 changes: 11 additions & 11 deletions app/apps/workflow/user_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 747550f

Please sign in to comment.