Changeset 11451
- Timestamp:
- 27 Feb 2014, 09:46:40 (11 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r11439 r11451 4 4 1.0.1dev (unreleased) 5 5 ===================== 6 7 * Provide customizable method for disabling student payments. 6 8 7 9 * After login and logout regular users (officers) are redirected -
main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py
r11450 r11451 143 143 return dict(getUtility(IKofaUtils).EXAM_GRADES)[value] 144 144 145 class DisablePaymentGroupSource(ContextualDictSourceFactoryBase): 146 """A source for filtering groups of students 147 """ 148 #: name of dict to deliver from kofa utils. 149 DICT_NAME = 'DISABLE_PAYMENT_GROUP_DICT' 150 145 151 # Define a validation method for email addresses 146 152 class NotAnEmailAddress(schema.ValidationError): … … 709 715 ) 710 716 717 payment_disabled = schema.List( 718 title = _(u'Payment disabled'), 719 value_type = schema.Choice( 720 source = DisablePaymentGroupSource(), 721 ), 722 required = False, 723 default = [], 724 ) 725 711 726 def getSessionString(): 712 727 """Returns the session string from the vocabulary. -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r11440 r11451 1028 1028 self.assertEqual(ac.owner, self.student_id) 1029 1029 self.assertEqual(ac.cost, 4567.0) 1030 return 1031 1032 def test_payment_disabled(self): 1033 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 1034 self.browser.open(self.payments_path) 1035 IWorkflowState(self.student).setState('cleared') 1036 self.browser.getLink("Add current session payment ticket").click() 1037 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 1038 self.browser.getControl("Create ticket").click() 1039 self.assertMatches('...ticket created...', 1040 self.browser.contents) 1041 self.app['configuration']['2004'].payment_disabled = ['sf_all'] 1042 self.browser.getLink("Add current session payment ticket").click() 1043 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 1044 self.browser.getControl("Create ticket").click() 1045 self.assertMatches('...Payment temporarily disabled...', 1046 self.browser.contents) 1030 1047 return 1031 1048 -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r10803 r11451 335 335 except KeyError: 336 336 return None 337 338 def _isPaymentDisabled(self, p_session, category, student): 339 academic_session = self._getSessionConfiguration(p_session) 340 if 'sf_all' in academic_session.payment_disabled: 341 return True 342 return False 337 343 338 344 def setPaymentDetails(self, category, student, … … 442 448 ticket.p_session == p_session: 443 449 return _('This type of payment has already been made.'), None 450 if self._isPaymentDisabled(p_session, category, student): 451 return _('Payment temporarily disabled.'), None 444 452 payment = createObject(u'waeup.StudentOnlinePayment') 445 453 timestamp = ("%d" % int(time()*10000))[1:] -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r10831 r11451 132 132 } 133 133 134 DISABLE_PAYMENT_GROUP_DICT = { 135 'sf_all': 'School Fee - All Students', 136 } 137 134 138 APP_CATS_DICT = { 135 139 'basic': 'Basic Application',
Note: See TracChangeset for help on using the changeset viewer.