Changeset 2136
- Timestamp:
- 21 Aug 2007, 09:02:13 (17 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Widgets.py
r2122 r2136 1599 1599 widget_id = self.getWidgetId() 1600 1600 file_name = datamodel[self.fields[0]] 1601 #import pdb; pdb.set_trace() 1602 if self.allow_resize: 1603 datastructure[self.getWidgetId() + '_resize'] = '' 1601 1604 datastructure[widget_id] = file_name 1602 1605 datastructure[widget_id + '_choice'] = 'change' … … 1608 1611 """Update datamodel from user data in datastructure. 1609 1612 """ 1610 #import pdb; pdb.set_trace()1611 1613 logger = logging.getLogger('Widgets.NoZodbImageWidget.validate') 1612 1614 datamodel = datastructure.getDataModel() … … 1624 1626 fileupload = datastructure[widget_id] 1625 1627 is_upload = isinstance(fileupload, FileUpload) 1626 if not is_upload: 1627 return True 1628 #import pdb; pdb.set_trace() 1629 if not is_upload and not datamodel[field_id]: 1630 if self.is_required: 1631 return self.validateError('cpsschemas_err_required', {}, 1632 datastructure) 1628 1633 if choice == 'delete': 1629 1634 if self.is_required: … … 1662 1667 store = True 1663 1668 1664 self.otherProcessing(choice, datastructure)1665 1669 1666 1670 # Find filename 1667 if is_upload :1671 if is_upload and store: 1668 1672 ext ='jpg' 1669 1673 filename = "%s_%s.%s" % (datastructure[self.id_field], 1670 1674 self.getWidgetId(), 1671 1675 ext) 1676 datamodel[field_id] = filename 1672 1677 registry = getToolByName(self, 'mimetypes_registry') 1673 1678 mimetype = registry.lookupExtension(filename.lower()) 1674 1679 if mimetype is not None: 1675 1680 mimetype = str(mimetype) # normalize 1676 1677 if store:1678 1681 # Set/update data 1679 file_path = "%s_%s.jpg" % (datamodel[self.id_field], 1680 field_id,) 1681 full_path = "%s/%s" % (self.storage_path, file_path) 1682 # file_path = "%s_%s.jpg" % (datamodel[self.id_field], 1683 # field_id,) 1684 full_path = "%s/%s" % (self.storage_path, filename) 1685 #import pdb; pdb.set_trace() 1682 1686 file = self.makeFile(filename, fileupload, datastructure) 1683 1687 # Fixup mimetype -
WAeUP_SRP/trunk/skins/waeup_student/apply_pume.py
r2134 r2136 117 117 commit = False, 118 118 ) 119 elif not dm.get('passport'):120 mode = "edit"121 psm = "Please upload Passport Photograph!"122 logger.info('%s tried to submit without uploading a passport foto' % (reg_no))119 # elif not dm.get('passport'): 120 # mode = "edit" 121 # psm = "Please upload Passport Photograph!" 122 # logger.info('%s tried to submit without uploading a passport foto' % (reg_no)) 123 123 elif not request.has_key('confirm'): 124 124 mode = "edit"
Note: See TracChangeset for help on using the changeset viewer.