Changeset 13123


Ignore:
Timestamp:
1 Jul 2015, 16:22:31 (9 years ago)
Author:
Henrik Bettermann
Message:

Do not create special application payment tickets with zero amount.

Location:
main/waeup.kofa/trunk
Files:
4 edited

Legend:

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

    r13103 r13123  
    441.3.2.dev0 (unreleased)
    55=======================
     6
     7* Do not create special application payment tickets with Zero amount.
    68
    79* Remove manual clearance lock. Replace `clearance_locked` field by
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r13101 r13123  
    652652            container, payment, self.context)
    653653        if failure is not None:
    654             self.flash(failure[0], type='danger')
     654            self.flash(failure, type='danger')
    655655            self.redirect(self.url(self.context))
    656656            return
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r13076 r13123  
    973973            applicant.application_number]).setPassword('apwd')
    974974        # Add session configuration object
    975         configuration = SessionConfiguration()
    976         configuration.academic_session = session_1
    977         configuration.transcript_fee = 200.0
    978         configuration.clearance_fee = 300.0
    979         self.app['configuration'].addSessionConfiguration(configuration)
     975        self.configuration = SessionConfiguration()
     976        self.configuration.academic_session = session_1
     977        #self.configuration.transcript_fee = 200.0
     978        self.configuration.clearance_fee = 300.0
     979        self.app['configuration'].addSessionConfiguration(self.configuration)
    980980
    981981
     
    996996            'transcript']
    997997        self.browser.getControl(name="form.date_of_birth").value = '09/09/1988'
    998         #self.browser.getControl(name="form.sex").value = ['m']
    999998        self.browser.getControl(name="form.email").value = 'xx@yy.zz'
    1000         self.browser.getControl("Save").click()
     999        self.configuration.transcript_fee = 0.0
     1000        self.browser.getControl("Save").click()
     1001        self.browser.getControl("Add online payment ticket").click()
     1002        self.assertMatches('...Amount could not be determined...',
     1003                           self.browser.contents)
     1004        self.configuration.transcript_fee = 200.0
     1005        self.browser.getLink("Edit application record").click()
    10011006        self.browser.getControl("Add online payment ticket").click()
    10021007        self.assertMatches('...Payment ticket created...',
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/utils.py

    r13076 r13123  
    5151            session_config = grok.getSite()['configuration'][session]
    5252        except KeyError:
    53             return _(u'Session configuration object is not available.'), None
     53            return _(u'Session configuration object is not available.')
    5454        payment.p_id = "p%s" % timestamp
    5555        payment.p_item = container.title
     
    5959            if applicant.special_application:
    6060                fee_name = applicant.special_application + '_fee'
    61                 payment.amount_auth = getattr(session_config, fee_name, 0.0)
     61                payment.amount_auth = getattr(session_config, fee_name, None)
     62                if payment.amount_auth in (0.0, None):
     63                    return _('Amount could not be determined.')
    6264                payment.p_category = applicant.special_application
    6365            return
     
    6971        payment.amount_auth = session_config.application_fee
    7072        if payment.amount_auth in (0.0, None):
    71             return _('Amount could not be determined.'), None
     73            return _('Amount could not be determined.')
    7274        return
    7375
Note: See TracChangeset for help on using the changeset viewer.