Added check against empty allowed paragraphs list
authorThierry Florac <thierry.florac@onf.fr>
Tue, 06 Feb 2018 11:38:32 +0100
changeset 357 d080c8f7c7da
parent 356 9922023810d3
child 358 d959b670cbe1
Added check against empty allowed paragraphs list
src/pyams_content/component/paragraph/zmi/__init__.py
--- a/src/pyams_content/component/paragraph/zmi/__init__.py	Tue Feb 06 11:16:42 2018 +0100
+++ b/src/pyams_content/component/paragraph/zmi/__init__.py	Tue Feb 06 11:38:32 2018 +0100
@@ -116,7 +116,7 @@
 
     def __new__(cls, context, request, view, manager):
         settings = get_parent(context, IParagraphFactorySettings)
-        for factory_name in settings.allowed_paragraphs:
+        for factory_name in settings.allowed_paragraphs or ():
             factory = query_utility(IParagraphFactory, name=factory_name)
             if factory.custom_menu:
                 return MenuDivider.__new__(cls)