Ignore:
Timestamp:
16 Sep 2021, 10:41:13 (3 years ago)
Author:
Henrik Bettermann
Message:

Extend exporter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/export.py

    r16067 r16621  
    4141        ))) + (
    4242        'password', 'state', 'history', 'container_code', 'application_number',
    43         'display_fullname', 'application_date')
     43        'display_fullname', 'application_date', 'dept',)
     44
     45    def mangle_value(self, value, name, context=None):
     46        if name == 'dept' and context is not None:
     47            course_admitted = getattr(context, 'course_admitted', None)
     48            if course_admitted is not None:
     49                value = course_admitted.__parent__.__parent__.code
     50        return super(
     51            CustomApplicantExporter, self).mangle_value(
     52            value, name, context=context)
    4453
    4554class CustomApplicantRefereeReportExporter(ApplicantRefereeReportExporter):
Note: See TracChangeset for help on using the changeset viewer.