Ignore:
Timestamp:
30 May 2011, 00:29:49 (14 years ago)
Author:
uli
Message:

Remove unwanted shit.

File:
1 edited

Legend:

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

    r6233 r6236  
    6262    def getInterfaces(self):
    6363        return implementedBy(CertificateContainer)
    64 
    65 @grok.subscribe(ICertificate, grok.IObjectAddedEvent)
    66 def handle_cert_addition(certificate, event):
    67     """XXX: Move me to certificates.py when everything works as expected.
    68     """
    69     cat = queryUtility(ICatalog, name='certificates_catalog', default=None)
    70     if cat is None:
    71         return
    72     entries = cat.searchResults(
    73         code=(certificate.code,certificate.code))
    74     if len(entries) == 0:
    75         return
    76     for entry in entries:
    77         if entry is not certificate:
    78             # XXX: Evil! We should find a way to block addition _before_
    79             #      it actually happens.
    80             del certificate.__parent__[certificate.__name__]
    81             raise ValueError('Certificate exists already elsewhere: % s' %
    82                              (certificate.code, ))
    83 
Note: See TracChangeset for help on using the changeset viewer.