Last change
on this file since 1591 was
1,
checked in by myroslav, 19 years ago
|
Building directory structure
|
File size:
740 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 | |
---|
13 | form = context.REQUEST.form |
---|
14 | email_key = 'Email_Discussion_Manager' |
---|
15 | |
---|
16 | if email_key in form: |
---|
17 | email = form[email_key] |
---|
18 | pu = getToolByName(context, 'plone_utils') |
---|
19 | if not pu.validateEmailAddresses(email): |
---|
20 | state.setError(email_key, 'Please submit a valid e-mail address.') |
---|
21 | |
---|
22 | if state.getErrors(): |
---|
23 | return state.set(status='failure', portal_status_message='Please correct the indicated errors.') |
---|
24 | else: |
---|
25 | return state |
---|
26 | |
---|
Note: See
TracBrowser
for help on using the repository browser.