- Timestamp:
- 30 May 2011, 07:15:54 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
r6235 r6243 1325 1325 entries = error.entries 1326 1326 for entry in entries: 1327 # show links to all certs with same code 1327 # do not use error.msg but render a more detailed message instead 1328 # and show links to all certs with same code 1328 1329 message = 'A certificate with same code already exists: ' 1329 1330 message += '<a href="%s">%s</a>' % ( -
main/waeup.sirp/trunk/src/waeup/sirp/university/batching.py
r6219 r6243 186 186 def addEntry(self, obj, row, site): 187 187 parent = self.getParent(row, site) 188 message = parent.addCertificate(obj) 189 if not message == 'Certificate added.': 190 return False 191 return True 188 parent.addCertificate(obj) 189 return 192 190 193 191 def delEntry(self, row, site): -
main/waeup.sirp/trunk/src/waeup/sirp/university/certificatecontainer.py
r6242 r6243 65 65 if len(entries) > 0: 66 66 raise DuplicationError( 67 'Certificate exists already elsewhere ', entries)67 'Certificate exists already elsewhere.', entries) 68 68 else: 69 69 # No catalog, then this addition won't do harm to anything. -
main/waeup.sirp/trunk/src/waeup/sirp/utils/batching.py
r6219 r6243 15 15 from zope.schema import getFields 16 16 from waeup.sirp.interfaces import ( 17 IBatchProcessor, ISchemaTypeConverter, FatalCSVError )17 IBatchProcessor, ISchemaTypeConverter, FatalCSVError, DuplicationError) 18 18 19 19 class BatchProcessor(grok.GlobalUtility): … … 282 282 continue 283 283 obj = self.callFactory() 284 #import pdb; pdb.set_trace()285 284 for key, value in row.items(): 286 285 setattr(obj, key, value) 287 if not self.addEntry(obj, row, site): 288 num_warns += 1 289 self.writeFailedRow( 290 failed_writer, raw_row, 291 "This object code already exists somewhere else. Skipping.") 286 try: 287 self.addEntry(obj, row, site) 288 except DuplicationError, error: 289 num_warns += 1 290 self.writeFailedRow( 291 failed_writer, raw_row, 292 "%s Skipping." % error.msg) 292 293 continue 293 294 elif mode == 'remove':
Note: See TracChangeset for help on using the changeset viewer.