From 2bfc809a6f3713dca01934dd95583219c19c1ea3 Mon Sep 17 00:00:00 2001 From: Alex de Landgraaf Date: Tue, 2 Jan 2024 17:35:31 +0100 Subject: [PATCH] [#1971] Double-check if our current status is an eindstatus due to eSuite having multiple eindstatusses --- src/open_inwoner/cms/cases/views/status.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/open_inwoner/cms/cases/views/status.py b/src/open_inwoner/cms/cases/views/status.py index aca16c3bc2..c7d3227321 100644 --- a/src/open_inwoner/cms/cases/views/status.py +++ b/src/open_inwoner/cms/cases/views/status.py @@ -172,6 +172,15 @@ def get_context_data(self, **kwargs): # The end status data is not passed if the end status has been reached, # because in that case the end status data is already included in `statuses` end_statustype = next((s for s in statustypen if s.is_eindstatus), None) + # The following check is a eSuite-specific workaround to deal with multiple statustypes per zaaktype having isEindstatus: true + # In the case when we have reached a statustype with isEindstatus set we assume this is our eindstatus + if ( + statuses + and statuses[-1].statustype + and statuses[-1].statustype.is_eindstatus + ): + end_statustype = statuses[-1].statustype + end_statustype_data = None if not status_types.get(end_statustype.url): end_statustype_data = {