required showed up, but validation needs it on field too. huh. this is not what i expected, but, well, its z3cforms

This commit is contained in:
Jens W. Klein 2014-03-26 11:27:12 +01:00
parent 822750697a
commit 2729f5a7e9

View File

@ -110,6 +110,7 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
if settings.anonymous_email_enabled:
# according to IDiscussionSettings.anonymous_email_enabled:
# "If selected, anonymous user will have to give their email."
self.widgets['author_email'].field.required = True
self.widgets['author_email'].required = True
else:
self.widgets['author_email'].mode = interfaces.HIDDEN_MODE