Changeset 7527 for main/waeup.sirp/trunk


Ignore:
Timestamp:
28 Jan 2012, 07:45:06 (13 years ago)
Author:
Henrik Bettermann
Message:

Set clearance_locked properly when importing students.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/student.py

    r7513 r7527  
    142142    and the transition create is fired. The latter produces a logging message.
    143143    """
    144     student.clearance_locked = True
     144    reg_state = IWorkflowState(student).getState()
     145    if reg_state == 'clearance started':
     146        student.clearance_locked = False
     147    else:
     148        student.clearance_locked = True
    145149    studycourse = StudentStudyCourse()
    146150    student['studycourse'] = studycourse
     
    156160    role_manager.assignRoleToPrincipal(
    157161        'waeup.local.StudentRecordOwner', student.student_id)
    158     if IWorkflowState(student).getState() is None:
     162    if reg_state is None:
    159163        IWorkflowInfo(student).fireTransition('create')
    160164    return
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/sample_student_data_migration.csv

    r7522 r7527  
    11student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,password,reg_state
    2 A123456,Aaren,Pieri,1,1990-01-02#,100000,aa@aa.ng,1234,mypw1,school fee paid
     2A123456,Aaren,Pieri,1,1990-01-02#,100000,aa@aa.ng,1234,mypw1,clearance started
    33B123456,Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234,mypw1,cleared
    44C123456,Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234,mypw1,admitted
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_batching.py

    r7522 r7527  
    200200        assert len(self.app['students'].keys()) == 4
    201201        self.assertTrue('A123456' in self.app['students'].keys())
    202         self.assertEqual(self.app['students']['A123456'].state,'school fee paid')
     202        self.assertEqual(self.app['students']['A123456'].state,'clearance started')
    203203        self.assertEqual(self.app['students']['A123456'].date_of_birth,
    204204            datetime.date(1990, 1, 2))
     205        self.assertFalse(self.app['students']['A123456'].clearance_locked)
    205206        self.assertEqual(self.app['students']['B123456'].state,'cleared')
    206207        self.assertEqual(self.app['students']['B123456'].date_of_birth,
    207208            datetime.date(1990, 1, 3))
     209        self.assertTrue(self.app['students']['B123456'].clearance_locked)
    208210        history = ' '.join(self.app['students']['A123456'].history.messages)
    209211        self.assertTrue(
    210             "State 'school fee paid' set by system" in history)
     212            "State 'clearance started' set by system" in history)
    211213        shutil.rmtree(os.path.dirname(fin_file))
    212214
Note: See TracChangeset for help on using the changeset viewer.