Changeset 11646 for main


Ignore:
Timestamp:
14 May 2014, 05:17:40 (11 years ago)
Author:
Henrik Bettermann
Message:

Use init_update and samePaymentMade methods.

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

Legend:

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

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

    r11636 r11646  
    6767
    6868    def update(self):
    69         student, certificate, xmldict = super(
    70             CustomInterswitchPageStudent, self).update()
     69        error = self.init_update()
     70        if error:
     71            self.flash(error, type='danger')
     72            self.redirect(self.url(self.context, '@@index'))
     73            return
     74        student = self.student
     75        xmldict = self.xmldict
    7176        # Provider data
    7277        xmldict['detail_ref'] = self.context.p_id
  • main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py

    r11623 r11646  
    251251        if amount in (0.0, None):
    252252            return _(u'Amount could not be determined.'), None
    253         for key in student['payments'].keys():
    254             ticket = student['payments'][key]
    255             if ticket.p_state == 'paid' and\
    256                ticket.p_category == category and \
    257                ticket.p_item == p_item and \
    258                ticket.p_session == p_session:
    259                   return _('This type of payment has already been made.'), None
     253        if self.samePaymentMade(student, category, p_item, p_session):
     254            return _('This type of payment has already been made.'), None
    260255        # Add session specific penalty fee.
    261256        if category == 'schoolfee' and student.is_postgrad:
Note: See TracChangeset for help on using the changeset viewer.