Ignore:
Timestamp:
2 Apr 2016, 06:10:01 (9 years ago)
Author:
Henrik Bettermann
Message:

Implement matric number constructor for diploma students.

Location:
main/waeup.aaue/trunk/src/waeup/aaue
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/locales/en/LC_MESSAGES/waeup.kofa.po

    r13656 r13793  
    5959"submit your application."
    6060
    61 #: waeup/kofa/interfaces.py:718
    6261msgid "Next Matriculation Number Integer"
    6362msgstr "Next PTP Matriculation Number Integer"
    6463
    65 #: waeup/kofa/interfaces.py:719
    6664msgid "Integer used for constructing the next matriculation number"
    6765msgstr ""
     
    6967"students"
    7068
    71 #: waeup/kofa/interfaces.py:727
    7269msgid "Next Matriculation Number Integer 2"
    7370msgstr "Next Regular Matriculation Number Integer"
    7471
    75 #: waeup/kofa/interfaces.py:736
    7672msgid "Next Matriculation Number Integer 3"
    7773msgstr "Next Postgraduate Matriculation Number Integer"
    7874
    79 #: waeup/kofa/interfaces.py:728
     75msgid "Next Matriculation Number Integer 4"
     76msgstr "Next Diploma Matriculation Number Integer"
     77
    8078msgid "2nd integer used for constructing the next matriculation number"
    8179msgstr ""
     
    8381"students"
    8482
    85 #: waeup/kofa/interfaces.py:737
    8683msgid "3rd integer used for constructing the next matriculation number"
    8784msgstr ""
    8885"Integer used for constructing the next matriculation number of postgraduate "
     86"students"
     87
     88msgid "4th integer used for constructing the next matriculation number"
     89msgstr ""
     90"Integer used for constructing the next matriculation number of diploma "
    8991"students"
    9092
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_utils.py

    r13755 r13793  
    129129        site['configuration'].next_matric_integer_2 = 1
    130130        site['configuration'].next_matric_integer_3 = 1
     131        site['configuration'].next_matric_integer_4 = 1
    131132        self.student.matric_number = None
    132133        #msg, mnumber = utils.setMatricNumber(self.student)
     
    165166        self.assertEqual(self.student.matric_number, 'AAU/SPS/ABC/dep1/04/AGRB/00001')
    166167        self.assertEqual(site['configuration'].next_matric_integer_3, 2)
     168        # Diploma Students get a matric number with leading 'IOS'
     169        # and the dp counter which is next_matric_integer_3.
     170        self.student['studycourse'].certificate.study_mode = 'dp_ft'
     171        self.student.matric_number = None
     172        msg, mnumber = utils.setMatricNumber(self.student)
     173        self.assertEqual(self.student.matric_number, 'IOE/DIP/04/00001')
     174        self.assertEqual(site['configuration'].next_matric_integer_4, 2)
    167175        # Foundation programme students don't get matric number.
    168176        self.student.matric_number = None
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r13786 r13793  
    5454            grok.getSite()['configuration'].next_matric_integer_3 += 1
    5555            return
     56        elif student.current_mode in ('dp_ft',):
     57            grok.getSite()['configuration'].next_matric_integer_4 += 1
     58            return
    5659        grok.getSite()['configuration'].next_matric_integer_2 += 1
    5760        return
     
    9194            return None, "PTP/%s/%s/%s/%05d" % (
    9295                faccode, depcode, year, next_integer)
     96        if student.current_mode in ('dp_ft',):
     97            next_integer = grok.getSite()['configuration'].next_matric_integer_4
     98            if next_integer == 0:
     99                return _('Matriculation number cannot be set.'), None
     100            return None, "IOE/DIP/%s/%05d" % (year, next_integer)
    93101        next_integer = grok.getSite()['configuration'].next_matric_integer_2
    94102        if next_integer == 0:
Note: See TracChangeset for help on using the changeset viewer.