web/views/massmailing.py
changeset 4161 4273f5094651
parent 4159 6b2b20c73d59
child 4252 6c4f109c2b03
--- a/web/views/massmailing.py	Mon Dec 21 19:52:21 2009 +0100
+++ b/web/views/massmailing.py	Mon Dec 21 20:00:18 2009 +0100
@@ -35,6 +35,10 @@
                                   **params)
 
 
+def recipient_vocabulary(form):
+    vocab = [(entity.get_email(), entity.eid) for entity in form.cw_rset.entities()]
+    return [(label, value) for label, value in vocab if label]
+
 class MassMailingForm(forms.FieldsForm):
     __regid__ = 'massmailing'
 
@@ -54,12 +58,6 @@
                               stdmsgs.BUTTON_CANCEL, 'CANCEL_EMAIL_ICON')]
     form_renderer_id = __regid__
 
-    def form_field_vocabulary(self, field):
-        if field.name == 'recipient':
-            vocab = [(entity.get_email(), entity.eid) for entity in self.cw_rset.entities()]
-            return [(label, value) for label, value in vocab if label]
-        return super(MassMailingForm, self).form_field_vocabulary(field)
-
     def __init__(self, *args, **kwargs):
         super(MassMailingForm, self).__init__(*args, **kwargs)
         field = self.field_by_name('mailbody')