Changeset 11648 for main/waeup.aaua


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

Use init_update and samePaymentMade methods.

Location:
main/waeup.aaua/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaua/trunk/CHANGES.txt

    r11637 r11648  
    441.2dev (unreleased)
    55===================
     6
     7* Use init_update and samePaymentMade methods.
    68
    79* Use base classes InterswitchPageApplicant and InterswitchPageStudent from
  • main/waeup.aaua/trunk/src/waeup/aaua/interswitch/browser.py

    r11637 r11648  
    7474
    7575    def update(self):
    76         student, certificate, xmldict = super(
    77             CustomInterswitchPageStudent, self).update()
     76        error = self.init_update()
     77        if error:
     78            self.flash(error, type='danger')
     79            self.redirect(self.url(self.context, '@@index'))
     80            return
     81        student = self.student
     82        xmldict = self.xmldict
    7883        # Provider data
    7984        xmldict['detail_ref'] = self.context.p_id
  • main/waeup.aaua/trunk/src/waeup/aaua/students/utils.py

    r11454 r11648  
    109109        if amount in (0.0, None):
    110110            return _('Amount could not be determined.'), None
    111         for key in student['payments'].keys():
    112             ticket = student['payments'][key]
    113             if ticket.p_state == 'paid' and\
    114                ticket.p_category == category and \
    115                ticket.p_item == p_item and \
    116                ticket.p_session == p_session:
    117                   return _('This type of payment has already been made.'), None
     111        if self.samePaymentMade(student, category, p_item, p_session):
     112            return _('This type of payment has already been made.'), None
    118113        if self._isPaymentDisabled(p_session, category, student):
    119114            return _('Payment temporarily disabled.'), None
Note: See TracChangeset for help on using the changeset viewer.