|
Last change
on this file since 805 was
800,
checked in by crchemist, 19 years ago
|
|
Deleted mistakable folder.
|
-
Property svn:eol-style set to
native
|
|
File size:
862 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 as __ |
|---|
| 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=__(u'Please correct the indicated errors.')) |
|---|
| 27 | else: |
|---|
| 28 | return state |
|---|
| 29 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.