Changeset 1907 for WAeUP_SRP/trunk/Widgets.py
- Timestamp:
- 16 Jun 2007, 14:09:52 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/Widgets.py
r1891 r1907 510 510 value = datastructure[widget_id].upper() 511 511 err = 0 512 mapping = {} 512 513 if len(value.split()) > 1: 513 514 err = 'Invalid Id, Id contains space(s).' 514 515 elif self.portal_catalog(portal_type=portal_type_query,id=value): 515 516 brain = self.portal_catalog(portal_type=portal_type_query,id=value)[0] 516 err = 'An %s object with the Id %s already exists at %s.'\ 517 % (brain.portal_type,value,brain.getPath()) 517 err = 'An ${portal_type} object with the Id ${id} already exists at ${path}.' 518 mapping = {'portal_type': brain.portal_type, 519 'id': value, 520 'path': brain.getPath(), 521 } 518 522 if err: 519 datastructure.setError(widget_id, err )523 datastructure.setError(widget_id, err, mapping) 520 524 else: 521 525 datamodel = datastructure.getDataModel() … … 1032 1036 #import pdb;pdb.set_trace() 1033 1037 err = 0 1038 mapping = {} 1034 1039 prefix= self.prefix 1035 1040 if prefix.startswith('@'): … … 1108 1113 if self.reference == "jamb_reg_no": 1109 1114 if hasattr(self.portal_directories.students,s_id): 1110 err = "Please login with your Student Id %s and 10-digit PIN." % s_id 1115 err = "Please login with your Student Id ${id} and 10-digit PIN." 1116 mapping = {'id': s_id} 1111 1117 s_logger.info('%s/%s repeatedly checked admission with PIN %s' % (s_id,ref,pin_str)) 1112 1118 break … … 1121 1127 s_logger.info('%s/%s has been created using PIN %s' % (s_id,ref,pin_str)) 1122 1128 except: 1123 err = "Please login with your Student Id %s and 10-digit PIN." % s_id 1129 err = "Please login with your Student Id ${id} and 10-digit PIN." 1130 mapping = {'id': s_id} 1124 1131 s_logger.info('%s/%s could not be made a member with PIN %s' % (s_id,ref,pin_str)) 1125 1132 break 1126 1133 break 1127 1134 if err: 1128 datastructure.setError(widget_id, err )1135 datastructure.setError(widget_id, err,mapping) 1129 1136 else: 1130 1137 datamodel = datastructure.getDataModel()
Note: See TracChangeset for help on using the changeset viewer.