Ignore:
Timestamp:
17 Jan 2017, 06:11:25 (8 years ago)
Author:
Henrik Bettermann
Message:

Move if statement to utility into method to ease customization.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
3 edited

Legend:

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

    r14405 r14410  
    8181                table[len(students_utils.gpa_boundaries)].append(line)
    8282                continue
    83         if level_obj.gpa_params[1] == 0:
    84             # No credits weighted
    85             table[0].append(line)
    86         else:
    87             gpaclass = students_utils.getDegreeClassNumber(level_obj)
    88             table[gpaclass].append(line)
     83        gpaclass = students_utils.getDegreeClassNumber(level_obj)
     84        table[gpaclass].append(line)
    8985        for i in range(len(students_utils.gpa_boundaries)+1):
    9086            if len(table[i]):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_session_results_presentation.py

    r14391 r14410  
    5252        result = get_students('fac1', 'dep1', 2010, 0)
    5353        self.assertEqual(result,
    54             [[(u'K1000000', u'1234', u'Bob Tester')], [], [], [], [], [], []])
     54            [[], [], [], [], [], [], [(u'K1000000', u'1234', u'Bob Tester')]])
    5555
    5656    def test_get_students_without_level_in_session(self):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r14382 r14410  
    840840        reports).
    841841        """
     842        if level_obj.gpa_params[1] == 0:
     843            # No credits weighted
     844            return 6
    842845        return self.getClassFromCGPA(level_obj.cumulative_params[0])[0]
    843846
Note: See TracChangeset for help on using the changeset viewer.