Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added status #1184

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading