Ignore:
Timestamp:
23 Feb 2017, 11:44:30 (8 years ago)
Author:
Henrik Bettermann
Message:

Add outstanding attribute to course tickets.

File:
1 edited

Legend:

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

    r14531 r14574  
    2525from zope.component.interfaces import IFactory
    2626from zope.catalog.interfaces import ICatalog
    27 from zope.component import createObject, queryUtility
     27from zope.component import createObject, queryUtility, getUtility
    2828from zope.interface import implementedBy
    29 from waeup.kofa.interfaces import academic_sessions_vocab, VALIDATED
     29from waeup.kofa.interfaces import academic_sessions_vocab, VALIDATED, IKofaUtils
    3030from waeup.kofa.students.interfaces import (
    3131    IStudentStudyLevel, IStudentNavigation, ICourseTicket)
     
    7979        total = 0
    8080        for ticket in self.values():
    81             total += ticket.credits
     81            if not ticket.outstanding:
     82                total += ticket.credits
    8283        return total
    8384
     
    135136    @property
    136137    def gpa(self):
    137         return self.gpa_params[0]
     138        """Return string formatted gpa value.
     139        """
     140        format_float = getUtility(IKofaUtils).format_float
     141        return format_float(self.gpa_params[0], 2)
    138142
    139143    @property
Note: See TracChangeset for help on using the changeset viewer.