Changeset 8434
- Timestamp:
- 12 May 2012, 16:27:14 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r8428 r8434 730 730 transition. 731 731 """ 732 allowed_transitions = self.wf_info.getManualTransitions() 732 allowed_transitions = [t for t in self.wf_info.getManualTransitions() 733 if not t[0] == 'pay'] 733 734 return [dict(name='', title=_('No transition'))] +[ 734 735 dict(name=x, title=y) for x, y in allowed_transitions] -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py
r8431 r8434 45 45 wf_info = IWorkflowInfo(self.__parent__) 46 46 try: 47 wf_info.fireTransition(' pay')47 wf_info.fireTransition('approve') 48 48 except InvalidTransitionError: 49 49 msg = log = 'Error: %s' % sys.exc_info()[1] -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/workflow.py
r8373 r8434 65 65 transition_id = 'pay', 66 66 title = _('Pay application fee'), 67 msg = _('Fee paid'), 67 msg = _('Payment made'), 68 source = STARTED, 69 destination = PAID), 70 71 Transition( 72 transition_id = 'approve', 73 title = _('Approve payment'), 74 msg = _('Payment approved'), 68 75 source = STARTED, 69 76 destination = PAID), -
main/waeup.kofa/trunk/src/waeup/kofa/payments/payment.py
r8429 r8434 83 83 self.p_state = 'paid' 84 84 user = get_current_principal() 85 r_desc = _('Payment approved by ${a}', mapping = {'a': user.id}) 85 user = get_current_principal() 86 if user is None: 87 # in tests 88 usertitle = 'system' 89 else: 90 usertitle = user.title 91 r_desc = _('Payment approved by ${a}', mapping = {'a': usertitle}) 86 92 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 87 93 self.r_desc = translate(r_desc, 'waeup.kofa', -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8428 r8434 362 362 transition. 363 363 """ 364 allowed_transitions = self.wf_info.getManualTransitions() 364 allowed_transitions = [t for t in self.wf_info.getManualTransitions() 365 if not t[0].startswith('pay')] 365 366 return [dict(name='', title=_('No transition'))] +[ 366 367 dict(name=x, title=y) for x, y in allowed_transitions] -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r8429 r8434 725 725 self.browser.getControl(name="transition").value = ['clear'] 726 726 self.browser.getControl("Save").click() 727 # Managers approve payment, they do not pay 728 self.assertFalse('pay_first_school_fee' in self.browser.contents) 727 729 self.browser.getControl( 728 name="transition").value = [' pay_first_school_fee']730 name="transition").value = ['approve_first_school_fee'] 729 731 self.browser.getControl("Save").click() 730 732 self.browser.getControl(name="transition").value = ['reset6'] … … 732 734 # In state returning the pay_school_fee transition triggers some 733 735 # changes of attributes 734 self.browser.getControl(name="transition").value = [' pay_school_fee']736 self.browser.getControl(name="transition").value = ['approve_school_fee'] 735 737 self.browser.getControl("Save").click() 736 738 self.assertEqual(student['studycourse'].current_session, 2005) # +1 … … 1399 1401 self.assertEqual(payment.r_amount_approved, 3456.0) 1400 1402 self.assertEqual(payment.r_code, 'AP') 1401 self.assertEqual(payment.r_desc, u'Payment approved by K1000000')1403 self.assertEqual(payment.r_desc, u'Payment approved by Anna Tester') 1402 1404 # The new CLR-0 pin has been created 1403 1405 self.assertEqual(len(self.app['accesscodes']['CLR-0']),1) -
main/waeup.kofa/trunk/src/waeup/kofa/students/workflow.py
r8309 r8434 90 90 91 91 Transition( 92 transition_id = 'approve_first_school_fee', 93 title = _('Approve payment'), 94 msg = _('School fee payment approved'), 95 source = CLEARED, 96 destination = PAID), 97 98 Transition( 92 99 transition_id = 'reset5', 93 100 title = _('Reset to cleared'), … … 100 107 title = _('Pay school fee'), 101 108 msg = _('School fee paid'), 109 source = RETURNING, 110 destination = PAID), 111 112 Transition( 113 transition_id = 'approve_school_fee', 114 title = _('Approve payment'), 115 msg = _('School fee payment approved'), 102 116 source = RETURNING, 103 117 destination = PAID), … … 193 207 if event.transition.transition_id in UNLOCK_CLEARANCE_TRANS: 194 208 obj.clearance_locked = False 195 # Student data don't change after first-time payment196 if event.transition.transition_id == 'pay_first_school_fee':197 pass198 209 # School fee payment of returning students triggers the change of 199 210 # current session, current level, and current verdict 200 if event.transition.transition_id == 'pay_school_fee': 211 if event.transition.transition_id in ( 212 'pay_school_fee', 'approve_school_fee'): 201 213 getUtility(IStudentsUtils).setReturningData(obj) 202 214 # In some tests we don't have a students container
Note: See TracChangeset for help on using the changeset viewer.