Skip to content

Commit

Permalink
Avoid attributerror when getting tipologia_notizia.
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Apr 18, 2024
1 parent 865b5c7 commit 840dbe3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Changelog
1.0.1 (unreleased)
------------------

- Nothing changed yet.
- Avoid attributerror when getting tipologia_notizia.
[cekk]


1.0.0 (2024-04-18)
Expand Down
5 changes: 3 additions & 2 deletions src/design/plone/ctgeneric/monkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

def get_design_meta_type(self):
ttool = api.portal.get_tool("portal_types")
if self.context.portal_type == "News Item" and self.context.tipologia_notizia:
tipologia_notizia = getattr(self.context, "tipologia_notizia", "")
if self.context.portal_type == "News Item" and tipologia_notizia:
return translate(
self.context.tipologia_notizia,
tipologia_notizia,
domain=_._domain,
context=self.request,
)
Expand Down

0 comments on commit 840dbe3

Please sign in to comment.