Ignore:
Timestamp:
28 May 2011, 10:56:27 (14 years ago)
Author:
Henrik Bettermann
Message:

Certificate codes must be unique. Check catalog when certificate are added. Flash the place if certificates exist.

To do: The certificate importer must also check for existing cerificate codes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r6183 r6210  
    13381338        certificate = createObject(u'waeup.Certificate')
    13391339        self.applyData(certificate, **data)
    1340 
    1341         #try:
    1342         #    self.applyData(certificate, **data)
    1343         #except NoTransitionAvailableError:
    1344         #    self.status = Invalid('Review state cannot be changed to '
    1345         #                          'requested state: no such transition '
    1346         #                          'available in workflow.')
    1347         #    return
    1348 
    1349         try:
    1350             self.context.certificates.addCertificate(certificate)
    1351         except KeyError:
    1352             self.status = Invalid('The name chosen already exists '
    1353                                   'in the database')
    1354             return
    1355         except DuplicationError:
    1356             self.status = Invalid('The name chosen already exists '
    1357                                   'in the database')
    1358             return
     1340        message = self.context.certificates.addCertificate(certificate)
     1341        self.flash(message)
    13591342        self.redirect(self.url(self.context, u'@@manage')+'#tab-3')
    13601343
Note: See TracChangeset for help on using the changeset viewer.