Changeset 6219 for main


Ignore:
Timestamp:
29 May 2011, 10:19:58 (14 years ago)
Author:
Henrik Bettermann
Message:

Use the message output of CertificateContainer?.addCertificate in CertificateProcessor?.addEntry and finally in BatchProcessor?.doImport to notify that the import failed. This can maybe merged with CertificateProcessor?.entryExists?!

Location:
main/waeup.sirp/trunk/src/waeup/sirp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/university/batching.py

    r5009 r6219  
    186186    def addEntry(self, obj, row, site):
    187187        parent = self.getParent(row, site)
    188         parent.addCertificate(obj)
    189         return
     188        message = parent.addCertificate(obj)
     189        if not message == 'Certificate added.':
     190            return False
     191        return True
    190192
    191193    def delEntry(self, row, site):
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/batching.py

    r5009 r6219  
    279279                    self.writeFailedRow(
    280280                        failed_writer, raw_row,
    281                         "This object already exists. Skipping.")
     281                        "This object already exists in the same container. Skipping.")
    282282                    continue
    283283                obj = self.callFactory()
     284                #import pdb; pdb.set_trace()
    284285                for key, value in row.items():
    285286                    setattr(obj, key, value)
    286                 self.addEntry(obj, row, site)
     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.")
     292                    continue
    287293            elif mode == 'remove':
    288294                if not self.entryExists(row, site):
Note: See TracChangeset for help on using the changeset viewer.