Ignore:
Timestamp:
14 May 2014, 05:30:03 (10 years ago)
Author:
Henrik Bettermann
Message:

Use init_update and samePaymentMade methods.

Location:
main/waeup.fceokene/trunk/src/waeup/fceokene
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/interswitch/browser.py

    r11635 r11649  
    5858
    5959    def update(self):
    60         student, certificate, xmldict = super(
    61             CustomInterswitchPageStudent, self).update()
     60        error = self.init_update()
     61        if error:
     62            self.flash(error, type='danger')
     63            self.redirect(self.url(self.context, '@@index'))
     64            return
     65        student = self.student
     66        xmldict = self.xmldict
    6267        # Provider data
    6368        provider_amt = 1600.0
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py

    r11457 r11649  
    278278        if amount in (0.0, None):
    279279            return _(u'Amount could not be determined.'), None
    280         for key in student['payments'].keys():
    281             ticket = student['payments'][key]
    282             if ticket.p_state == 'paid' and\
    283                ticket.p_category == category and \
    284                ticket.p_item == p_item and \
    285                ticket.p_session == p_session:
    286                   return _('This type of payment has already been made.'), None
     280        if self.samePaymentMade(student, category, p_item, p_session):
     281            return _('This type of payment has already been made.'), None
    287282        if self._isPaymentDisabled(p_session, category, student):
    288283            return _('Payment temporarily disabled.'), None
Note: See TracChangeset for help on using the changeset viewer.