Changeset 13664


Ignore:
Timestamp:
8 Feb 2016, 16:03:04 (9 years ago)
Author:
Henrik Bettermann
Message:

Use degree instead of certcode.

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

Legend:

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

    r13609 r13664  
    154154        self.student['studycourse'].certificate.study_mode = 'special_pg_ft'
    155155        self.student.matric_number = None
     156        self.certificate.degree = 'AGRB'
    156157        msg, mnumber = utils.setMatricNumber(self.student)
    157         self.assertEqual(self.student.matric_number, 'AAU/SPS/ABC/dep1/04/CERT1/00001')
     158        self.assertEqual(self.student.matric_number, 'AAU/SPS/ABC/dep1/04/AGRB/00001')
    158159        self.assertEqual(site['configuration'].next_matric_integer_3, 2)
    159160        # Foundation programme students don't get matric number.
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r13636 r13664  
    6161        depcode = student.depcode
    6262        certcode = student.certcode
     63        degree = getattr(
     64            getattr(student.get('studycourse', None), 'certificate', None),
     65                'degree', None)
    6366        year = unicode(student.entry_session)[2:]
    6467        if not student.state in (PAID, ) or not student.is_fresh or \
     
    6770        if student.is_postgrad:
    6871            next_integer = grok.getSite()['configuration'].next_matric_integer_3
    69             if next_integer == 0:
     72            if not degree or next_integer == 0:
    7073                return _('Matriculation number cannot be set.'), None
    7174            return None, "AAU/SPS/%s/%s/%s/%s/%05d" % (
    72                 faccode, depcode, year, certcode, next_integer)
     75                faccode, depcode, year, degree, next_integer)
    7376        if student.current_mode in ('ug_pt', 'de_pt'):
    7477            next_integer = grok.getSite()['configuration'].next_matric_integer
Note: See TracChangeset for help on using the changeset viewer.