Skip to content

Commit 2bfc809

Browse files
committed
[#1971] Double-check if our current status is an eindstatus due to eSuite having multiple eindstatusses
1 parent 1dda63d commit 2bfc809

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

+9
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,15 @@ def get_context_data(self, **kwargs):
172172
# The end status data is not passed if the end status has been reached,
173173
# because in that case the end status data is already included in `statuses`
174174
end_statustype = next((s for s in statustypen if s.is_eindstatus), None)
175+
# The following check is a eSuite-specific workaround to deal with multiple statustypes per zaaktype having isEindstatus: true
176+
# In the case when we have reached a statustype with isEindstatus set we assume this is our eindstatus
177+
if (
178+
statuses
179+
and statuses[-1].statustype
180+
and statuses[-1].statustype.is_eindstatus
181+
):
182+
end_statustype = statuses[-1].statustype
183+
175184
end_statustype_data = None
176185
if not status_types.get(end_statustype.url):
177186
end_statustype_data = {

0 commit comments

Comments
 (0)