Added test on themes manager
authorThierry Florac <tflorac@ulthar.net>
Wed, 27 Jan 2021 15:46:21 +0100
changeset 1448 0f646872d21b
parent 1447 53f02f01df65
child 1449 b74f6ea0f791
Added test on themes manager
src/pyams_content/component/theme/zmi/__init__.py
--- a/src/pyams_content/component/theme/zmi/__init__.py	Wed Jan 13 14:10:56 2021 +0100
+++ b/src/pyams_content/component/theme/zmi/__init__.py	Wed Jan 27 15:46:21 2021 +0100
@@ -141,9 +141,10 @@
         if 'themes' in self.widgets:
             widget = self.widgets['themes']
             target = get_parent(self.context, IThemesManagerTarget)
-            manager = IThemesManager(target)
-            widget.thesaurus_name = manager.thesaurus_name
-            widget.extract_name = manager.extract_name
+            if target is not None:
+                manager = IThemesManager(target)
+                widget.thesaurus_name = manager.thesaurus_name
+                widget.extract_name = manager.extract_name
 
 
 @adapter_config(context=(IThemesTarget, IAdminLayer, BaseThemesEditForm), provides=IPageHeader)