Ignore:
Timestamp:
29 May 2011, 13:47:39 (14 years ago)
Author:
uli
Message:

Get closer to the roots of the problem and override setitem to be
sure we do not store duplicate certificate entries.

File:
1 edited

Legend:

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

    r6221 r6223  
    1515    grok.require('waeup.manageUniversity')
    1616
    17     def addCertificate(self, certificate):
     17    def __setitem__(self, name, certificate):
    1818        """XXX: docstring missing.
    1919        """
     
    3131            # No catalog, then this addition won't do harm to anything.
    3232            pass
    33         self[certificate.code] = certificate
     33        super(CertificateContainer, self).__setitem__(name, certificate)
     34
     35    def addCertificate(self, certificate):
     36        self[getattr(certificate, 'code', None)] = certificate
    3437
    3538    def clear(self):
Note: See TracChangeset for help on using the changeset viewer.