Added constraint in tags manager
authorThierry Florac <thierry.florac@onf.fr>
Thu, 13 Dec 2018 14:26:46 +0100
changeset 1165 ed74d431911f
parent 1164 e36bc019bbd9
child 1166 32668a609c7b
Added constraint in tags manager
src/pyams_content/component/theme/interfaces.py
src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo
src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po
src/pyams_content/locales/pyams_content.pot
--- a/src/pyams_content/component/theme/interfaces.py	Thu Dec 13 09:44:21 2018 +0100
+++ b/src/pyams_content/component/theme/interfaces.py	Thu Dec 13 14:26:46 2018 +0100
@@ -57,6 +57,11 @@
                                      vocabulary='PyAMS thesaurus names',
                                      required=False)
 
+    @invariant
+    def check_glossary_thesaurus(self):
+        if self.enable_glossary and not self.glossary_thesaurus_name:
+            raise Invalid(_("You must specify a glossary thesaurus to activate it!"))
+
 
 class ITagsManagerTarget(IThesaurusContextManagerTarget):
     """Marker interface for tags manager"""
Binary file src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.mo has changed
--- a/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po	Thu Dec 13 09:44:21 2018 +0100
+++ b/src/pyams_content/locales/fr/LC_MESSAGES/pyams_content.po	Thu Dec 13 14:26:46 2018 +0100
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-12-13 09:43+0100\n"
+"POT-Creation-Date: 2018-12-13 14:12+0100\n"
 "PO-Revision-Date: 2015-09-10 10:42+0200\n"
 "Last-Translator: Thierry Florac <tflorac@ulthar.net>\n"
 "Language-Team: French\n"
@@ -1511,8 +1511,8 @@
 msgstr "Mode de rendu utilisé par ce chapô"
 
 #: src/pyams_content/component/theme/__init__.py:72
-#: src/pyams_content/component/theme/interfaces.py:68
-#: src/pyams_content/component/theme/interfaces.py:82
+#: src/pyams_content/component/theme/interfaces.py:73
+#: src/pyams_content/component/theme/interfaces.py:87
 #: src/pyams_content/component/theme/zmi/portlet.py:40
 #: src/pyams_content/shared/common/zmi/search.py:188
 #: src/pyams_content/root/zmi/search.py:177
@@ -1521,16 +1521,16 @@
 msgstr "Tags"
 
 #: src/pyams_content/component/theme/__init__.py:120
-#: src/pyams_content/component/theme/interfaces.py:109
-#: src/pyams_content/component/theme/interfaces.py:123
+#: src/pyams_content/component/theme/interfaces.py:114
+#: src/pyams_content/component/theme/interfaces.py:128
 #: src/pyams_content/component/theme/zmi/portlet.py:55
 #: src/pyams_content/shared/common/zmi/search.py:191
 msgid "Themes"
 msgstr "Thèmes"
 
 #: src/pyams_content/component/theme/__init__.py:168
-#: src/pyams_content/component/theme/interfaces.py:150
-#: src/pyams_content/component/theme/interfaces.py:164
+#: src/pyams_content/component/theme/interfaces.py:155
+#: src/pyams_content/component/theme/interfaces.py:169
 #: src/pyams_content/component/theme/zmi/portlet.py:70
 #: src/pyams_content/shared/common/zmi/search.py:194
 msgid "Collections"
@@ -1582,6 +1582,12 @@
 "Vous devez indiquer la cible de la recherche lorsque vous activez la "
 "recherche par tags !"
 
+#: src/pyams_content/component/theme/interfaces.py:63
+msgid "You must specify a glossary thesaurus to activate it!"
+msgstr ""
+"Vous devez indiquer le nom du thésaurus contenant les termes du glossaire "
+"pour pouvoir l'activer !"
+
 #: src/pyams_content/component/theme/zmi/__init__.py:55
 #: src/pyams_content/shared/view/zmi/theme.py:56
 msgid "Tags..."
--- a/src/pyams_content/locales/pyams_content.pot	Thu Dec 13 09:44:21 2018 +0100
+++ b/src/pyams_content/locales/pyams_content.pot	Thu Dec 13 14:26:46 2018 +0100
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE 1.0\n"
-"POT-Creation-Date: 2018-12-13 09:43+0100\n"
+"POT-Creation-Date: 2018-12-13 14:12+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1429,8 +1429,8 @@
 msgstr ""
 
 #: ./src/pyams_content/component/theme/__init__.py:72
-#: ./src/pyams_content/component/theme/interfaces.py:68
-#: ./src/pyams_content/component/theme/interfaces.py:82
+#: ./src/pyams_content/component/theme/interfaces.py:73
+#: ./src/pyams_content/component/theme/interfaces.py:87
 #: ./src/pyams_content/component/theme/zmi/portlet.py:40
 #: ./src/pyams_content/shared/common/zmi/search.py:188
 #: ./src/pyams_content/root/zmi/search.py:177
@@ -1439,16 +1439,16 @@
 msgstr ""
 
 #: ./src/pyams_content/component/theme/__init__.py:120
-#: ./src/pyams_content/component/theme/interfaces.py:109
-#: ./src/pyams_content/component/theme/interfaces.py:123
+#: ./src/pyams_content/component/theme/interfaces.py:114
+#: ./src/pyams_content/component/theme/interfaces.py:128
 #: ./src/pyams_content/component/theme/zmi/portlet.py:55
 #: ./src/pyams_content/shared/common/zmi/search.py:191
 msgid "Themes"
 msgstr ""
 
 #: ./src/pyams_content/component/theme/__init__.py:168
-#: ./src/pyams_content/component/theme/interfaces.py:150
-#: ./src/pyams_content/component/theme/interfaces.py:164
+#: ./src/pyams_content/component/theme/interfaces.py:155
+#: ./src/pyams_content/component/theme/interfaces.py:169
 #: ./src/pyams_content/component/theme/zmi/portlet.py:70
 #: ./src/pyams_content/shared/common/zmi/search.py:194
 msgid "Collections"
@@ -1496,6 +1496,10 @@
 msgid "You must specify search target when activating search by tags!"
 msgstr ""
 
+#: ./src/pyams_content/component/theme/interfaces.py:63
+msgid "You must specify a glossary thesaurus to activate it!"
+msgstr ""
+
 #: ./src/pyams_content/component/theme/zmi/__init__.py:55
 #: ./src/pyams_content/shared/view/zmi/theme.py:56
 msgid "Tags..."