Changeset 3284


Ignore:
Timestamp:
7 Mar 2008, 17:25:28 (17 years ago)
Author:
joachim
Message:

upload file only if upload-object does not exist.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/Widgets.py

    r3277 r3284  
    22722272                return self.validateError('only csv files allowed', {},
    22732273                                          datastructure)
     2274            uploads_folder = self.portal_url.getPortalObject().campus.uploads
     2275            if hasattr(uploads_folder,filename):
     2276                return self.validateError('upload object exists', {},
     2277                                          datastructure)
    22742278            datamodel[field_id] = filename
    22752279            registry = getToolByName(self, 'mimetypes_registry')
     
    22822286                file.content_type = mimetype
    22832287            file_path = os.path.join(self.storage_path,filename)
    2284             #import pdb; pdb.set_trace()
    22852288            data = open(file_path,"w")
    22862289            data.write(str(file.data))
Note: See TracChangeset for help on using the changeset viewer.