Changeset 14480


Ignore:
Timestamp:
31 Jan 2017, 11:33:00 (8 years ago)
Author:
Henrik Bettermann
Message:

We use this source also for various reports.
In such a case the context of the source will be the
certificate itself.

File:
1 edited

Legend:

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

    r13076 r14480  
    3030from waeup.kofa.utils.countries import COUNTRIES
    3131from waeup.kofa.university.vocabularies import course_levels
     32from waeup.kofa.university.certificate import Certificate
    3233
    3334
     
    6061
    6162def study_levels(context):
    62     certificate = getattr(context, 'certificate', None)
     63    if isinstance(context, Certificate):
     64        certificate = context
     65    else:
     66        certificate = getattr(context, 'certificate', None)
    6367    start_level, end_level = (None, None)
    6468    if  certificate is not None:
     
    8185
    8286    def getTitle(self, context, value):
    83         certificate = getattr(context, 'certificate', None)
     87        if isinstance(context, Certificate):
     88            # We use this source also for various reports.
     89            # In such a case the context of the source will be the
     90            # certificate itself.
     91            certificate = context
     92        else:
     93            certificate = getattr(context, 'certificate', None)
    8494        if certificate is not None:
    8595            start_level = int(certificate.start_level)
Note: See TracChangeset for help on using the changeset viewer.