Ignore:
Timestamp:
22 May 2012, 08:39:48 (13 years ago)
Author:
Henrik Bettermann
Message:

Reset _curr_stud_id if student_id has been imported.

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

Legend:

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

    r8490 r8491  
    136136        parent = self.getParent(row, site)
    137137        parent.addStudent(obj)
     138        # Reset _curr_stud_id if student_id has been imported
     139        if self.getLocator(row) == 'student_id':
     140            parent._curr_stud_id -= 1
    138141        # We have to log this if state is provided. If not,
    139142        # logging is done by the event handler handle_student_added
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py

    r8490 r8491  
    356356        self.assertEqual(
    357357            self.app['students']['X666666'].state, 'courses validated')
    358         self.assertEqual(self.app['students']._curr_stud_id, 1000005)
     358        # Two new student_ids have been created.
     359        self.assertEqual(self.app['students']._curr_stud_id, 1000003)
    359360        shutil.rmtree(os.path.dirname(fin_file))
    360361
Note: See TracChangeset for help on using the changeset viewer.