Skip to content

Commit 468e678

Browse files
committed
[Venray #133] Adding a featureflag to allow showing cases without a status
1 parent 0960e2f commit 468e678

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/open_inwoner/cms/cases/views/services.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def _get_cases_for_api_group(self, group: ZGWApiGroupConfig) -> list[Zaak]:
197197
resolved_cases = self.resolve_cases(raw_cases, group)
198198

199199
filtered_cases = [
200-
case for case in resolved_cases if case.status and is_zaak_visible(case)
200+
case for case in resolved_cases if is_zaak_visible(case)
201201
]
202202
filtered_cases.sort(key=lambda case: case.startdatum, reverse=True)
203203
return filtered_cases

src/open_inwoner/openzaak/models.py

+7
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,13 @@ def form_service(self, service):
438438
default=False,
439439
)
440440

441+
show_cases_without_status = models.BooleanField(
442+
verbose_name=_(
443+
"By default cases are only shown if they have a status set."
444+
),
445+
default=False,
446+
)
447+
441448
title_text = models.TextField(
442449
verbose_name=_("Title text"),
443450
help_text=_(

src/open_inwoner/openzaak/utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ def is_zaak_visible(zaak: Zaak) -> bool:
4949
if isinstance(zaak.zaaktype, str):
5050
raise ValueError("expected zaak.zaaktype to be resolved from url to model")
5151

52+
if not zaak.status and not config.show_cases_without_status:
53+
return False
54+
5255
if not zaak.zaaktype or zaak.zaaktype.indicatie_intern_of_extern != "extern":
5356
return False
5457

0 commit comments

Comments
 (0)