diff --git a/CHANGES.rst b/CHANGES.rst index 503ff5d..54037f2 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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) diff --git a/src/design/plone/ctgeneric/monkey.py b/src/design/plone/ctgeneric/monkey.py index 8e8798b..500c1bf 100644 --- a/src/design/plone/ctgeneric/monkey.py +++ b/src/design/plone/ctgeneric/monkey.py @@ -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, )