Skip to content

Commit

Permalink
Merge pull request #916 from maykinmedia/issue/sentry-346889-fix-and-…
Browse files Browse the repository at this point in the history
…logging-3

[Sentry 346889] Fixing fallback and additional logging for determinin…
  • Loading branch information
alextreme authored Dec 28, 2023
2 parents aeff3b3 + 300842a commit ff6dba9
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/open_inwoner/cms/cases/views/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,17 @@ def get_second_status_preview(self, statustypen: list) -> Optional[StatusType]:

@property
def is_file_upload_enabled_for_case_type(self) -> bool:
return ZaakTypeInformatieObjectTypeConfig.objects.filter_enabled_for_case_type(
self.case.zaaktype
).exists()
case_upload_enabled = (
ZaakTypeInformatieObjectTypeConfig.objects.filter_enabled_for_case_type(
self.case.zaaktype
).exists()
)
logger.info(
"Case {url} has case type file upload: {case_upload_enabled}".format(
url=self.case.url, case_upload_enabled=case_upload_enabled
)
)
return case_upload_enabled

@property
def is_file_upload_enabled_for_statustype(self) -> bool:
Expand All @@ -286,13 +294,21 @@ def is_file_upload_enabled_for_statustype(self) -> bool:
case=self.case
)
)
return False
except KeyError:
logger.info(
"Could not retrieve status type config for url {url}".format(
url=self.case.status.statustype.url
)
)
return False
logger.info(
"Case {url} status type {status_type} has status type file upload: {enabled_for_status_type}".format(
url=self.case.url,
status_type=self.case.status.statustype,
enabled_for_status_type=enabled_for_status_type,
)
)
return enabled_for_status_type

@property
Expand Down

0 comments on commit ff6dba9

Please sign in to comment.