Changed vocabulary declaration
authorThierry Florac <thierry.florac@onf.fr>
Tue, 15 Nov 2016 10:44:51 +0100
changeset 25 8a67d57d53c6
parent 24 6fd8d188d2da
child 26 fed07be83b9a
Changed vocabulary declaration
src/pyams_workflow/workflow.py
--- a/src/pyams_workflow/workflow.py	Tue Oct 11 17:08:11 2016 +0200
+++ b/src/pyams_workflow/workflow.py	Tue Nov 15 10:44:51 2016 +0100
@@ -25,12 +25,12 @@
 from pyams_utils.registry import get_utility
 from pyams_utils.request import check_request
 from pyams_utils.traversing import get_parent
+from pyams_utils.vocabulary import vocabulary_config
 from pyramid.httpexceptions import HTTPUnauthorized
 from pyramid.threadlocal import get_current_registry
 from zope.componentvocabulary.vocabulary import UtilityVocabulary
 from zope.interface import implementer
 from zope.lifecycleevent import ObjectModifiedEvent
-from zope.schema.vocabulary import getVocabularyRegistry
 
 from pyams_workflow import _
 
@@ -274,10 +274,9 @@
         return [transition for transition in transitions if transition.trigger == trigger]
 
 
+@vocabulary_config(name='PyAMS workflows')
 class WorkflowsVocabulary(UtilityVocabulary):
     """Workflows vocabulary"""
 
     interface = IWorkflow
     nameOnly = True
-
-getVocabularyRegistry().register('PyAMS workflows', WorkflowsVocabulary)