Added test
authorThierry Florac <tflorac@ulthar.net>
Sat, 21 Jul 2018 02:36:35 +0200
changeset 878 6bc257d7f53f
parent 877 957488ef021d
child 879 47173c13e118
Added test
src/pyams_content/features/menu/portlet/navigation/zmi/simple.py
--- a/src/pyams_content/features/menu/portlet/navigation/zmi/simple.py	Sat Jul 21 00:10:00 2018 +0200
+++ b/src/pyams_content/features/menu/portlet/navigation/zmi/simple.py	Sat Jul 21 02:36:35 2018 +0200
@@ -35,7 +35,7 @@
 from pyams_portal.zmi.portlet import PortletSettingsEditor, PortletSettingsPropertiesEditor
 from pyams_template.template import template_config
 from pyams_utils.adapter import adapter_config
-from zope.interface import alsoProvides, Interface
+from zope.interface import Interface
 
 from pyams_content import _
 
@@ -87,4 +87,7 @@
         if not IInternalLink.providedBy(link):
             return True
         target = link.get_target()
-        return (target is not None) and IWorkflowPublicationInfo(target).is_published()
+        if target is not None:
+            publication_info = IWorkflowPublicationInfo(target, None)
+            if publication_info is not None:
+                return publication_info.is_published()