Updated pictograms vocabulary to handle empty table
authorThierry Florac <thierry.florac@onf.fr>
Tue, 12 Jun 2018 14:32:37 +0200
changeset 627 e350df2967ea
parent 626 bab57ca5013b
child 628 baf2d9499054
Updated pictograms vocabulary to handle empty table
src/pyams_content/reference/pictograms/manager.py
--- a/src/pyams_content/reference/pictograms/manager.py	Tue Jun 12 10:55:04 2018 +0200
+++ b/src/pyams_content/reference/pictograms/manager.py	Tue Jun 12 14:32:37 2018 +0200
@@ -58,7 +58,7 @@
             target = get_parent(context, IPictogramManagerTarget)
             if target is not None:
                 manager = IPictogramManager(target)
-                pictograms = [table.get(name) for name in manager.selected_pictograms]
+                pictograms = [table.get(name) for name in manager.selected_pictograms or ()]
                 terms = [SimpleTerm(v.__name__,
                                     title=II18n(v).query_attribute('title', request=request))
                          for v in pictograms if v is not None]