web/views/massmailing.py
branchtls-sprint
changeset 635 305da8d6aa2d
parent 431 18b4dd650ef8
child 640 8e64f12be69c
--- a/web/views/massmailing.py	Mon Feb 16 20:05:55 2009 +0100
+++ b/web/views/massmailing.py	Mon Feb 16 20:06:18 2009 +0100
@@ -10,17 +10,16 @@
 from logilab.mtconverter import html_escape
 
 from cubicweb.interfaces import IEmailable
+from cubicweb.selectors import implements, match_user_groups
 from cubicweb.common.view import EntityView
-from cubicweb.common.selectors import implement_interface, match_user_group
 from cubicweb.web.action import EntityAction
 from cubicweb.web import stdmsgs
 
 
 class SendEmailAction(EntityAction):
     category = 'mainactions'
-    __selectors__ = (implement_interface, match_user_group)
-    accepts_interfaces = (IEmailable,) # XXX should check email is set as well
-    require_groups = ('managers', 'users')
+    # XXX should check email is set as well
+    __selectors__ = (implements(IEmailable), match_user_groups('managers', 'users'))
 
     id = 'sendemail'
     title = _('send email')
@@ -35,10 +34,7 @@
 
 class MassMailingForm(EntityView):
     id = 'massmailing'
-    __selectors__ = (implement_interface, match_user_group)
-    accepts_interfaces = (IEmailable,)
-    require_groups = ('managers', 'users')
-    
+    __selectors__ = (implements(IEmailable), match_user_groups('managers', 'users'))
 
     form_template = u"""
 <div id="compose">