Ignore:
Timestamp:
8 Jul 2022, 06:11:37 (2 years ago)
Author:
Henrik Bettermann
Message:

Do not require session configuration object for application payments.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r16976 r17009  
    979979        self.browser.open(self.edit_path)
    980980        self.browser.getControl("Add online payment ticket").click()
    981         # Session object missing
    982         self.assertTrue(
    983             'Session configuration object is not available'
    984             in self.browser.contents)
    985         configuration = SessionConfiguration()
    986         configuration.academic_session = session_1
    987         self.app['configuration'].addSessionConfiguration(configuration)
    988981        self.browser.open(self.edit_path)
    989982        self.browser.getControl("Add online payment ticket").click()
     
    11251118        self.app['configuration'].addSessionConfiguration(self.configuration)
    11261119
    1127 
    11281120    def test_pay_special_fee(self):
    11291121        self.prepare_special_container()
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/utils.py

    r16545 r17009  
    6262        """
    6363        timestamp = ("%d" % int(time()*10000))[1:]
    64         if container.year:
    65             session = str(container.year)
    66             try:
    67                 session_config = grok.getSite()['configuration'][session]
    68             except KeyError:
    69                 return _(u'Session configuration object is not available.')
    7064        payment.p_id = "p%s" % timestamp
    7165        payment.p_item = container.title
     
    7771        if applicant.special:
    7872            if applicant.special_application:
     73                try:
     74                    session_config = grok.getSite()['configuration'][
     75                        str(payment.p_session)]
     76                except KeyError:
     77                    return _(u'Session configuration object is not available.')   
    7978                fee_name = applicant.special_application + '_fee'
    8079                payment.amount_auth = getattr(session_config, fee_name, None)
Note: See TracChangeset for help on using the changeset viewer.