Changeset 11619 for main


Ignore:
Timestamp:
5 May 2014, 14:28:44 (11 years ago)
Author:
Henrik Bettermann
Message:

Let constructMatricNumber return error message.

File:
1 edited

Legend:

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

    r11595 r11619  
    519519        next_integer = grok.getSite()['configuration'].next_matric_integer
    520520        if next_integer == 0:
    521             return None
    522         return unicode(next_integer)
     521            return _('Matriculation number cannot be set.'), None
     522        return None, unicode(next_integer)
    523523
    524524    def setMatricNumber(self, student):
     
    535535        This method is tested but not used in the base package. It can
    536536        be used in custom packages by adding respective views
    537         and by customizing _composeMatricNumber according to the
     537        and by customizing constructMatricNumber according to the
    538538        university's matriculation number construction rules.
    539539
     
    544544        if student.certcode is None:
    545545            return _('No certificate assigned.'), None
    546         matric_number = self.constructMatricNumber(student)
    547         if not matric_number:
    548             return _('Matriculation number cannot be set.'), None
     546        error, matric_number = self.constructMatricNumber(student)
     547        if error:
     548            return error, None
    549549        try:
    550550            student.matric_number = matric_number
Note: See TracChangeset for help on using the changeset viewer.