Last change
on this file since 864 was
806,
checked in by crchemist, 17 years ago
|
Add role 'Editor' to portal.
|
-
Property svn:eol-style set to
native
|
File size:
873 bytes
|
Line | |
---|
1 | ## Controller Script Python "validate_setup" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind state=state |
---|
7 | ##bind subpath=traverse_subpath |
---|
8 | ##parameters= |
---|
9 | ##title=validates qpc setup |
---|
10 | ## |
---|
11 | from Products.CMFCore.utils import getToolByName |
---|
12 | from Products.CMFPlone import MessageFactory |
---|
13 | from Products.CMFPlone import PloneMessageFactory |
---|
14 | _ = MessageFactory('plonecomments') |
---|
15 | |
---|
16 | form = context.REQUEST.form |
---|
17 | email_key = 'email_discussion_manager' |
---|
18 | |
---|
19 | if email_key in form: |
---|
20 | email = form[email_key] |
---|
21 | pu = getToolByName(context, 'plone_utils') |
---|
22 | if not pu.validateEmailAddresses(email): |
---|
23 | state.setError(email_key, _(u'Please submit a valid e-mail address.')) |
---|
24 | |
---|
25 | if state.getErrors(): |
---|
26 | return state.set(status='failure', portal_status_message=PloneMessageFactory(u'Please correct the indicated errors.')) |
---|
27 | else: |
---|
28 | return state |
---|
29 | |
---|
Note: See
TracBrowser
for help on using the repository browser.