Changeset 6742
- Timestamp:
- 13 Sep 2011, 09:25:33 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py
r6664 r6742 13 13 sid = u"%c%d" % (letter,r().randint(99999,1000000)) 14 14 return sid 15 16 def set_returning_data(student): 17 student['studycourse'].current_level += 100 18 student['studycourse'].current_session += 1 19 verdict = student['studycourse'].current_verdict 20 student['studycourse'].current_verdict = '' 21 student['studycourse'].previous_verdict = verdict 22 return -
main/waeup.sirp/trunk/src/waeup/sirp/students/vocabularies.py
r6725 r6742 17 17 curr_year = datetime.now().year 18 18 year_range = range(curr_year - 10, curr_year + 2) 19 return [('%s/%s' % (year,year+1), '%s' %year) for year in year_range]19 return [('%s/%s' % (year,year+1), year) for year in year_range] 20 20 21 21 entry_session_vocab = SimpleWAeUPVocabulary(*entry_sessions()) … … 64 64 65 65 verdicts = SimpleWAeUPVocabulary( 66 ('Not set',''), 66 67 ('Successful student','A'), 67 68 ('Student with carryover courses','B'), -
main/waeup.sirp/trunk/src/waeup/sirp/students/workflow.py
r6723 r6742 5 5 from hurry.workflow.workflow import Transition, WorkflowState, NullCondition 6 6 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 7 from waeup.sirp.students.interfaces import IStudent8 7 from waeup.sirp.interfaces import IObjectHistory, IWAeUPWorkflowInfo 9 8 from waeup.sirp.workflow import WAeUPWorkflow, WAeUPWorkflowInfo 10 9 from waeup.sirp.utils.helpers import get_current_principal 10 from waeup.sirp.students.interfaces import IStudent 11 from waeup.sirp.students.utils import set_returning_data 11 12 12 13 CREATED = 'created' … … 15 16 REQUESTED = 'clearance requested' 16 17 CLEARED = 'cleared' 18 PAID = 'school fee paid' 19 RETURNING = 'returning' 17 20 18 21 REGISTRATION_TRANSITIONS = ( … … 80 83 source = CLEARED, 81 84 destination = CLEARANCE), 85 86 Transition( 87 transition_id = 'pay_first_school_fee', 88 title = 'Pay school fee', 89 msg = 'School fee paid', 90 source = CLEARED, 91 destination = PAID), 92 93 Transition( 94 transition_id = 'reset5', 95 title = 'Reset to cleared', 96 msg = 'Student record reset to cleared', 97 source = PAID, 98 destination = CLEARED), 99 100 Transition( 101 transition_id = 'pay_school_fee', 102 title = 'Pay school fee', 103 msg = 'School fee paid', 104 source = RETURNING, 105 destination = PAID), 106 107 Transition( 108 transition_id = 'reset6', 109 title = 'Reset to returning', 110 msg = 'Student record reset to returning', 111 source = PAID, 112 destination = RETURNING), 82 113 ) 83 114 … … 117 148 if event.transition.transition_id in UNLOCK_CLEARANCE_TRANS: 118 149 obj.clearance_locked = False 150 # Student data don't change after first-time payment 151 if event.transition.transition_id == 'pay_first_school_fee': 152 pass 153 # School fee payment of returning students triggers the change of 154 # current session, current level, and current verdict 155 if event.transition.transition_id == 'pay_school_fee': 156 set_returning_data(obj) 119 157 # In some tests we don't have a students container or a user 120 158 try:
Note: See TracChangeset for help on using the changeset viewer.