Last change
on this file since 3417 was
2518,
checked in by mylan, 14 years ago
|
#192: Updated configlet verification form
|
-
Property svn:eol-style set to
native
|
File size:
794 bytes
|
Rev | Line | |
---|
[1593] | 1 | ## Script (Python) "create_verify_file" |
---|
| 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
[2518] | 7 | ##parameters= |
---|
[1593] | 8 | ##title=Create file for verification |
---|
| 9 | ## |
---|
| 10 | |
---|
| 11 | from Products.CMFCore.utils import getToolByName |
---|
| 12 | portal = getToolByName(context, 'portal_url').getPortalObject() |
---|
[2518] | 13 | sitemap_view = portal.restrictedTraverse("sitemap_settings") |
---|
| 14 | isAdded, res = sitemap_view.uploadVerificationFile(context.REQUEST) |
---|
| 15 | if isAdded: |
---|
| 16 | state.set(status="success", |
---|
| 17 | portal_status_message = 'Plone Google Sitemap updated.') |
---|
[1593] | 18 | else: |
---|
[2518] | 19 | state.set(status="failure", |
---|
| 20 | portal_status_message = 'Error on file upload: "%s"' % res) |
---|
| 21 | #context.plone_utils.addPortalMessage(_(u'Please correct the indicated errors.'), 'error') |
---|
[1593] | 22 | |
---|
[2518] | 23 | return state |
---|
Note: See
TracBrowser
for help on using the repository browser.