Last change
on this file since 841 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
|
Rev | Line | |
---|
[1] | 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 |
---|
[800] | 12 | from Products.CMFPlone import MessageFactory |
---|
[806] | 13 | from Products.CMFPlone import PloneMessageFactory |
---|
[800] | 14 | _ = MessageFactory('plonecomments') |
---|
[1] | 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): |
---|
[800] | 23 | state.setError(email_key, _(u'Please submit a valid e-mail address.')) |
---|
[1] | 24 | |
---|
| 25 | if state.getErrors(): |
---|
[806] | 26 | return state.set(status='failure', portal_status_message=PloneMessageFactory(u'Please correct the indicated errors.')) |
---|
[1] | 27 | else: |
---|
| 28 | return state |
---|
| 29 | |
---|
Note: See
TracBrowser
for help on using the repository browser.