Changeset 11590


Ignore:
Timestamp:
22 Apr 2014, 14:46:45 (11 years ago)
Author:
Henrik Bettermann
Message:

Do not construct matric number if no certificate is assigned.

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

Legend:

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

    r11589 r11590  
    7171        self.assertEqual(mnumber, None)
    7272        self.assertEqual(self.student.matric_number, None)
     73        # Certificate must be set.
     74        self.student.matric_number = None
     75        another_student.matric_number = u'999'
     76        self.student['studycourse'].certificate = None
     77        msg, mnumber = utils.setMatricNumber(self.student)
     78        self.assertEqual(msg, 'No certificate assigned.')
    7379        return
    7480
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r11589 r11590  
    542542        if student.matric_number is not None:
    543543            return _('Matriculation number already set.'), None
     544        if student.certcode is None:
     545            return _('No certificate assigned.'), None
    544546        try:
    545547            student.matric_number = self._constructMatricNumber(
Note: See TracChangeset for help on using the changeset viewer.