Correction in JSON response of AJAX term update form
authorThierry Florac <thierry.florac@onf.fr>
Mon, 29 Jan 2018 16:56:44 +0100
changeset 44 c41afb5121fd
parent 43 bef87ac04ecf
child 45 c019dedce267
Correction in JSON response of AJAX term update form
src/pyams_thesaurus/zmi/term.py
--- a/src/pyams_thesaurus/zmi/term.py	Sat Jan 27 00:40:58 2018 +0100
+++ b/src/pyams_thesaurus/zmi/term.py	Mon Jan 29 16:56:44 2018 +0100
@@ -252,7 +252,7 @@
         else:
             term_changes = changes.get(IThesaurusTerm, ())
             if ('status' in term_changes) or ('label' in term_changes):
-                label = self.context.generic.label.replace("'", "&#039;")
+                label = (self.context.generic or self.context).label.replace("'", "&#039;")
                 return {'status': 'callback',
                         'callback': 'PyAMS_thesaurus.tree.updateTerm',
                         'options': {'term': label}}