- Timestamp:
- 29 May 2011, 09:23:30 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/university/certificatecontainer.py
r6213 r6216 4 4 from waeup.sirp.university.interfaces import ( 5 5 ICertificateContainer, ICertificate) 6 from zope.component.interfaces import IFactory 6 from zope.component.interfaces import IFactory, ComponentLookupError 7 7 from zope.catalog.interfaces import ICatalog 8 8 from zope.component import getUtility … … 19 19 raise TypeError('CertificateContainers contain only ' 20 20 'ICertificate instances') 21 cat = getUtility(ICatalog, name='certificates_catalog') 21 try: 22 cat = getUtility(ICatalog, name='certificates_catalog') 23 except ComponentLookupError: 24 # catalog not available. This might happen during tests. 25 self[certificate.code] = certificate 26 return 'Certificate added (for tests only).' 22 27 results = list(cat.searchResults(code=(certificate.code,certificate.code))) 23 28 if results:
Note: See TracChangeset for help on using the changeset viewer.