Added control for missing pictograms
authorThierry Florac <thierry.florac@onf.fr>
Mon, 27 Aug 2018 15:16:42 +0200
changeset 891 f69af721c84b
parent 890 316eb15688bd
child 892 1d2f9975056e
Added control for missing pictograms
src/pyams_content/component/paragraph/zmi/pictogram.py
--- a/src/pyams_content/component/paragraph/zmi/pictogram.py	Mon Aug 27 11:49:21 2018 +0200
+++ b/src/pyams_content/component/paragraph/zmi/pictogram.py	Mon Aug 27 15:16:42 2018 +0200
@@ -264,7 +264,9 @@
     def getValue(self, obj):
         value = super(PictogramsTableNameColumn, self).getValue(obj)
         if not value:
-            value = II18n(obj.pictogram).query_attribute('header', request=self.request)
+            pictogram = obj.pictogram
+            if pictogram is not None:
+                value = II18n(pictogram).query_attribute('header', request=self.request)
         return value or BaseParagraph.empty_title