Skip to content

Commit

Permalink
[#1941] Fix error on failed status type retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
pi-sigma authored and alextreme committed Dec 14, 2023
1 parent 484d5ed commit 36fa48a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/open_inwoner/cms/cases/views/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class InnerCaseDetailView(
template_name = "pages/cases/status_inner.html"
form_class = CaseUploadForm
contact_form_class = CaseContactForm
case: Zaak = None
case: Optional[Zaak] = None

def __init__(self):
self.statustype_config_mapping = {
Expand Down Expand Up @@ -279,6 +279,13 @@ def is_file_upload_enabled_for_statustype(self) -> bool:
enabled_for_status_type = self.statustype_config_mapping[
self.case.status.statustype.url
].document_upload_enabled
except AttributeError:
logger.info(
"Could not retrieve status type for case {case}; "
"the status has not been resolved to a ZGW model object.".format(
case=self.case
)
)
except KeyError:
logger.info(
"Could not retrieve status type config for url {url}".format(
Expand Down

0 comments on commit 36fa48a

Please sign in to comment.