Check for missing settings in menu divider
authorThierry Florac <tflorac@ulthar.net>
Thu, 08 Feb 2018 11:54:00 +0100
changeset 376 62318b795eef
parent 375 292bbdf6bf40
child 377 20f42f602162
Check for missing settings in menu divider
src/pyams_content/component/paragraph/zmi/__init__.py
--- a/src/pyams_content/component/paragraph/zmi/__init__.py	Thu Feb 08 09:24:38 2018 +0100
+++ b/src/pyams_content/component/paragraph/zmi/__init__.py	Thu Feb 08 11:54:00 2018 +0100
@@ -116,6 +116,8 @@
 
     def __new__(cls, context, request, view, manager):
         settings = get_parent(context, IParagraphFactorySettings)
+        if settings is None:
+            return MenuDivider.__new__(cls)
         for factory_name in settings.allowed_paragraphs or ():
             factory = query_utility(IParagraphFactory, name=factory_name)
             if factory.custom_menu: