Handle null values in terms selection tree
authorThierry Florac <thierry.florac@onf.fr>
Tue, 28 Aug 2018 16:48:52 +0200
changeset 85 677ca6c7a21b
parent 84 a3ca2f2dd419
child 86 04f176e237cc
Handle null values in terms selection tree
src/pyams_thesaurus/zmi/widget/templates/terms-tree-input.pt
--- a/src/pyams_thesaurus/zmi/widget/templates/terms-tree-input.pt	Tue Aug 28 11:43:39 2018 +0200
+++ b/src/pyams_thesaurus/zmi/widget/templates/terms-tree-input.pt	Tue Aug 28 16:48:52 2018 +0200
@@ -17,7 +17,7 @@
 								   id="term_${subterm/label}"
 								   name="${view/name}:list"
 								   value="${subterm/label}"
-								   checked="${python:'checked' if subterm.label in view.value else None}" />
+								   checked="${python:'checked' if subterm.label in (view.value or ()) else None}" />
 							<i></i>
 							<div class="${python:'' if published else 'bold margin-top-5'}">
 								${python:subterm.alt or subterm.label}