Ignore:
Timestamp:
23 Aug 2015, 10:05:17 (9 years ago)
Author:
Henrik Bettermann
Message:

Extend and use ApplicantsPlugin? to update existing instances.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/root.py

    r13212 r13214  
    2323from hurry.query.interfaces import IQuery
    2424from zope.component import getUtility
     25from zope.component.interfaces import ComponentLookupError
     26from zope.catalog.interfaces import ICatalog
     27from zope.catalog.field import FieldIndex
    2528from zope.schema import getFields
    2629from waeup.kofa.interfaces import IKofaPluggable
     
    8992            #    logger.info(
    9093            #        '%s: description_dict added to root.' % self.log_prefix)
     94            try:
     95                cat = getUtility(ICatalog, name='applicants_catalog')
     96                if 'record_used' not in cat.keys():
     97                    nothing_to_do = False
     98                    cat[u'record_used'] = FieldIndex(field_name=u'record_used')
     99                    cat.updateIndexes()
     100                    logger.info(
     101                        '%s: record_used index added to applicants_catalog.'
     102                        % self.log_prefix)
     103            except ComponentLookupError: # in unit tests
     104                pass
    91105            if nothing_to_do:
    92106                logger.info(
Note: See TracChangeset for help on using the changeset viewer.