Changed vocabulary declaration
authorThierry Florac <thierry.florac@onf.fr>
Tue, 15 Nov 2016 09:59:17 +0100
changeset 6 8927221a0675
parent 5 ac54083bbe98
child 7 aac7434f38be
Changed vocabulary declaration
src/pyams_mail/mailer.py
--- a/src/pyams_mail/mailer.py	Thu Jun 02 15:46:08 2016 +0200
+++ b/src/pyams_mail/mailer.py	Tue Nov 15 09:59:17 2016 +0100
@@ -16,19 +16,15 @@
 
 # import interfaces
 from pyramid_mailer.interfaces import IMailer
-from zope.schema.interfaces import IVocabularyFactory
 
 # import packages
-from zope.interface import provider
+from pyams_utils.vocabulary import vocabulary_config
 from zope.componentvocabulary.vocabulary import UtilityVocabulary
-from zope.schema.vocabulary import getVocabularyRegistry
 
 
-@provider(IVocabularyFactory)
+@vocabulary_config(name='PyAMS mailer utilities')
 class MailerVocabulary(UtilityVocabulary):
     """Mailer vocabulary"""
 
     interface = IMailer
     nameOnly = True
-
-getVocabularyRegistry().register('PyAMS mailer utilities', MailerVocabulary)