Changeset 2516 in products
- Timestamp:
- Jun 11, 2010 8:57:02 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/configletview.py
r2515 r2516 2 2 from zope.interface import implements, Interface, Attribute 3 3 4 from OFS.Image import cookId 5 from OFS.ObjectManager import BadRequestException 4 6 from Products.Five import BrowserView 5 7 from Products.CMFCore.utils import getToolByName … … 43 45 """ 44 46 47 def uploadVerificationFile(vfile): 48 """ Upload passed site verification file to the site. 49 On success - update googlesitemaps verification files list. 50 Return tuple where : 51 1. boolean value - is verification file successfully created. 52 2. string value: 53 2.1. if successfull - id of created verification file 54 2.2. if failure - error descirption 55 """ 45 56 46 57 class ConfigletSettingsView(BrowserView): … … 138 149 props._updateProperty('verification_filenames', vfs) 139 150 return vfs 151 152 def uploadVerificationFile(self, request): 153 vfilename = "" 154 portal = self.pps.portal() 155 try: 156 import pdb;pdb.set_trace() 157 vfile = request.get("verification_file") 158 vfilename, vftitle = cookId("", "", vfile) 159 portal.manage_addFile(id="", file=vfile) 160 portal[vfilename].manage_addProperty( 161 'CreatedBy', 'quintagroupt.plonegooglesitemaps','string') 162 except BadRequestException, e: 163 return False, str(e) 164 else: 165 props = self.tools.properties().googlesitemap_properties 166 vfilenames = list(props.getProperty('verification_filenames',[])) 167 vfilenames.append(vfilename) 168 props.manage_changeProperties(verification_filenames = vfilenames) 169 return True, vfilename
Note: See TracChangeset
for help on using the changeset viewer.