--- a/web/test/unittest_form.py Mon Oct 25 17:15:54 2010 +0200
+++ b/web/test/unittest_form.py Mon Oct 25 17:15:55 2010 +0200
@@ -143,7 +143,7 @@
state.eid = 'S'
form = RTFForm(self.req, redirect_path='perdu.com', entity=state)
# make it think it can use fck editor anyway
- form.field_by_name('description', 'subject').format = lambda x: 'text/html'
+ form.field_by_name('description', 'subject').format = lambda form, field=None: 'text/html'
self.assertMultiLineEqual(self._render_entity_field('description', form),
expected % {'eid': state.eid})
--- a/web/views/massmailing.py Mon Oct 25 17:15:54 2010 +0200
+++ b/web/views/massmailing.py Mon Oct 25 17:15:55 2010 +0200
@@ -65,13 +65,13 @@
sender = ff.StringField(widget=TextInput({'disabled': 'disabled'}),
label=_('From:'),
- value=lambda f: '%s <%s>' % (
- f._cw.user.dc_title(),
- f._cw.user.cw_adapt_to('IEmailable').get_email()))
+ value=lambda form, field: '%s <%s>' % (
+ form._cw.user.dc_title(),
+ form._cw.user.cw_adapt_to('IEmailable').get_email()))
recipient = ff.StringField(widget=CheckBox(), label=_('Recipients:'),
choices=recipient_vocabulary,
- value= lambda f: [entity.eid for entity in f.cw_rset.entities()
- if entity.cw_adapt_to('IEmailable').get_email()])
+ value= lambda form, field: [entity.eid for entity in form.cw_rset.entities()
+ if entity.cw_adapt_to('IEmailable').get_email()])
subject = ff.StringField(label=_('Subject:'), max_length=256)
mailbody = ff.StringField(widget=AjaxWidget(wdgtype='TemplateTextField',
inputid='mailbody'))
@@ -146,7 +146,7 @@
def call(self):
form = self._cw.vreg['forms'].select('massmailing', self._cw,
rset=self.cw_rset)
- self.w(form.render())
+ form.render(w=self.w)
class SendMailController(controller.Controller):