add anonymous_email_enabled settings to really let integrator activate it. add the migration script which add the option to the registry and do not change the behavior: the email will not be displayed by default

This commit is contained in:
JeanMichel FRANCOIS
2013-01-04 19:00:24 +01:00
parent 84ba3661e0
commit a16958c1c7
5 changed files with 29 additions and 6 deletions
+4 -5
View File
@@ -105,13 +105,12 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
self.widgets['author_name'].mode = interfaces.HIDDEN_MODE
self.widgets['author_email'].mode = interfaces.HIDDEN_MODE
# Todo: Since we are not using the author_email field in the
# current state, we hide it by default. But we keep the field for
# integrators or later use.
self.widgets['author_email'].mode = interfaces.HIDDEN_MODE
registry = queryUtility(IRegistry)
settings = registry.forInterface(IDiscussionSettings, check=False)
if mtool.isAnonymousUser() and not settings.anonymous_email_enabled:
self.widgets['author_email'].mode = interfaces.HIDDEN_MODE
member = mtool.getAuthenticatedMember()
member_email = member.getProperty('email')