Ignore:
Timestamp:
4 Apr 2014, 08:37:59 (11 years ago)
Author:
Henrik Bettermann
Message:

Show correct flash message color after payment.

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  
    684684
    685685    def update(self):
    686         msg, log = self.context.approveApplicantPayment()
     686        flashtype, msg, log = self.context.approveApplicantPayment()
    687687        if log is not None:
    688688            applicant = self.context.__parent__
     
    695695                self.context.p_id, self.context.p_category,
    696696                self.context.amount_auth, self.context.r_code))
    697         self.flash(msg, type='warning')
     697        self.flash(msg, type=flashtype)
    698698        return
    699699
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py

    r11575 r11580  
    5050            except InvalidTransitionError:
    5151                msg = log = 'Error: %s' % sys.exc_info()[1]
    52                 return msg, log
     52                return 'danger', msg, log
    5353        log = 'payment approved: %s' % self.p_id
    5454        msg = _('Payment approved')
    55         return msg, log
     55        flashtype = 'success'
     56        return flashtype, msg, log
    5657
    5758    def doAfterApplicantPayment(self):
     
    6465            except InvalidTransitionError:
    6566                msg = log = 'Error: %s' % sys.exc_info()[1]
    66                 return msg, log
     67                return 'danger', msg, log
    6768        log = 'successful payment: %s' % self.p_id
    6869        msg = _('Successful payment')
    69         return msg, log
     70        flashtype = 'success'
     71        return flashtype, msg, log
    7072
    7173    def approveApplicantPayment(self):
     
    7375        """
    7476        if self.p_state == 'paid':
    75             return _('This ticket has already been paid.'), None
     77            return 'warning', _('This ticket has already been paid.'), None
    7678        self.approve()
    7779        return self.doAfterApplicantPaymentApproval()
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r11570 r11580  
    18561856
    18571857    def update(self):
    1858         msg, log = self.context.approveStudentPayment()
     1858        flashtype, msg, log = self.context.approveStudentPayment()
    18591859        if log is not None:
    18601860            # Add log message to students.log
     
    18661866                self.context.p_id, self.context.p_category,
    18671867                self.context.amount_auth, self.context.r_code))
    1868         self.flash(msg)
     1868        self.flash(msg, type=flashtype)
    18691869        return
    18701870
  • main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py

    r11570 r11580  
    107107            error = self._createActivationCodes()
    108108            if error is not None:
    109                 return error, error
     109                return 'danger', error, error
    110110        log = 'successful %s payment: %s' % (self.p_category, self.p_id)
    111111        msg = _('Successful payment')
    112         return msg, log
     112        flashtype = 'success'
     113        return flashtype, msg, log
    113114
    114115    def doAfterStudentPaymentApproval(self):
     
    118119            error = self._createActivationCodes()
    119120            if error is not None:
    120                 return error, error
     121                return 'danger', error, error
    121122        log = '%s payment approved: %s' % (self.p_category, self.p_id)
    122123        msg = _('Payment approved')
    123         return msg, log
     124        flashtype = 'success'
     125        return flashtype, msg, log
    124126
    125127    def approveStudentPayment(self):
     
    127129        """
    128130        if self.p_state == 'paid':
    129             return _('This ticket has already been paid.'), None
     131            return 'warning', _('This ticket has already been paid.'), None
    130132        self.approve()
    131133        return self.doAfterStudentPaymentApproval()
Note: See TracChangeset for help on using the changeset viewer.