Changeset 11580 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 4 Apr 2014, 08:37:59 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r11578 r11580 684 684 685 685 def update(self): 686 msg, log = self.context.approveApplicantPayment()686 flashtype, msg, log = self.context.approveApplicantPayment() 687 687 if log is not None: 688 688 applicant = self.context.__parent__ … … 695 695 self.context.p_id, self.context.p_category, 696 696 self.context.amount_auth, self.context.r_code)) 697 self.flash(msg, type= 'warning')697 self.flash(msg, type=flashtype) 698 698 return 699 699 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py
r11575 r11580 50 50 except InvalidTransitionError: 51 51 msg = log = 'Error: %s' % sys.exc_info()[1] 52 return msg, log52 return 'danger', msg, log 53 53 log = 'payment approved: %s' % self.p_id 54 54 msg = _('Payment approved') 55 return msg, log 55 flashtype = 'success' 56 return flashtype, msg, log 56 57 57 58 def doAfterApplicantPayment(self): … … 64 65 except InvalidTransitionError: 65 66 msg = log = 'Error: %s' % sys.exc_info()[1] 66 return msg, log67 return 'danger', msg, log 67 68 log = 'successful payment: %s' % self.p_id 68 69 msg = _('Successful payment') 69 return msg, log 70 flashtype = 'success' 71 return flashtype, msg, log 70 72 71 73 def approveApplicantPayment(self): … … 73 75 """ 74 76 if self.p_state == 'paid': 75 return _('This ticket has already been paid.'), None77 return 'warning', _('This ticket has already been paid.'), None 76 78 self.approve() 77 79 return self.doAfterApplicantPaymentApproval() -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r11570 r11580 1856 1856 1857 1857 def update(self): 1858 msg, log = self.context.approveStudentPayment()1858 flashtype, msg, log = self.context.approveStudentPayment() 1859 1859 if log is not None: 1860 1860 # Add log message to students.log … … 1866 1866 self.context.p_id, self.context.p_category, 1867 1867 self.context.amount_auth, self.context.r_code)) 1868 self.flash(msg )1868 self.flash(msg, type=flashtype) 1869 1869 return 1870 1870 -
main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py
r11570 r11580 107 107 error = self._createActivationCodes() 108 108 if error is not None: 109 return error, error109 return 'danger', error, error 110 110 log = 'successful %s payment: %s' % (self.p_category, self.p_id) 111 111 msg = _('Successful payment') 112 return msg, log 112 flashtype = 'success' 113 return flashtype, msg, log 113 114 114 115 def doAfterStudentPaymentApproval(self): … … 118 119 error = self._createActivationCodes() 119 120 if error is not None: 120 return error, error121 return 'danger', error, error 121 122 log = '%s payment approved: %s' % (self.p_category, self.p_id) 122 123 msg = _('Payment approved') 123 return msg, log 124 flashtype = 'success' 125 return flashtype, msg, log 124 126 125 127 def approveStudentPayment(self): … … 127 129 """ 128 130 if self.p_state == 'paid': 129 return _('This ticket has already been paid.'), None131 return 'warning', _('This ticket has already been paid.'), None 130 132 self.approve() 131 133 return self.doAfterStudentPaymentApproval()
Note: See TracChangeset for help on using the changeset viewer.