Ignore:
Timestamp:
6 Apr 2023, 17:29:31 (21 months ago)
Author:
Henrik Bettermann
Message:

Enable customization of certificate select box entries also in the students section.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/university/vocabularies.py

    r16812 r17376  
    108108    in the portal.
    109109    """
    110     def getValues(self, context):
    111         catalog = getUtility(ICatalog, name='certificates_catalog')
    112         return sorted(list(
    113             catalog.searchResults(
    114                 code=(None, None))),
    115                       key=lambda value: value.code)
    116110
    117111    def getToken(self, context, value):
    118112        return value.code
    119113
     114    def getValues(self, context):
     115        catalog = getUtility(ICatalog, name='certificates_catalog')
     116        result = catalog.searchResults(code=(None, None))
     117        resultlist = getUtility(
     118            IKofaUtils).sortCertificates(context, result)
     119        return resultlist
     120
    120121    def getTitle(self, context, value):
    121         return "%s - %s" % (value.code, value.title)
     122        return getUtility(
     123            IKofaUtils).getCertTitle(context, value)
    122124
    123125class SpecialApplicationSource(ContextualDictSourceFactoryBase):
Note: See TracChangeset for help on using the changeset viewer.