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

[#1971] Double-check if our current status is an eindstatus due to eS… #923

Merged
merged 1 commit into from
Jan 4, 2024
Merged
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
9 changes: 9 additions & 0 deletions src/open_inwoner/cms/cases/views/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

@stevenbal stevenbal Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alextreme Wouldn't this line become irrelevant after the changes you made? If I understand it correctly, the conditional below would always be triggered and override end_statustype to be the statustype of the last status (if is_eindstatus is True) right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I indeed went for the most minimal change for my hotfix for v1.12. I suspect you're correct and have updated this branch to remove this line and avoid future confusion

Copy link
Contributor

@stevenbal stevenbal Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm okay I may have been wrong, I glanced over that fact that in this line the statustypen are used directly, so that way we will still get the end_statustype even if this status hasn't been reached yet, so I think we still need this line 😅

I removed the change.

# 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 = {
Expand Down
Loading