Ignore:
Timestamp:
6 Feb 2025, 04:31:05 (3 days ago)
Author:
Henrik Bettermann
Message:

Filter applicants. If ‚PG‘ in officer’s description, only pg applicants are listest. If not, non-pg applicants are listed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/browser/pages.py

    r17736 r18002  
    2424    TranscriptOfficerLandingPage,
    2525    DatacenterImportStep2)
     26from waeup.kofa.utils.helpers import get_user_account
    2627from waeup.kofa.university.interfaces import ICertificate
    2728from waeup.kofa.interfaces import IUniversity
     
    116117        return
    117118
     119    @property
     120    def getApplicants(self):
     121        filtered_applicants = []
     122        applicants = super(CustomTranscriptOfficerLandingPage, self).getApplicants
     123        officer_descr = get_user_account(self.request).description
     124        if officer_descr  and 'PG' in officer_descr:
     125            for applicant in applicants:
     126                entry_mode = applicant[0].entry_mode
     127                if entry_mode and entry_mode.startswith('pg'):
     128                    filtered_applicants.append(applicant)
     129        else:
     130            for applicant in applicants:
     131                entry_mode = applicant[0].entry_mode
     132                if entry_mode and not entry_mode.startswith('pg'):
     133                    filtered_applicants.append(applicant)
     134        return filtered_applicants
     135
    118136class CustomDatacenterImportStep2(DatacenterImportStep2):
    119137
Note: See TracChangeset for help on using the changeset viewer.