Ignore:
Timestamp:
5 Apr 2016, 06:12:48 (9 years ago)
Author:
Henrik Bettermann
Message:

Only new students are allowed to pay acceptance fee.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py

    r13778 r13800  
    266266
    267267        error, payment = utils.setPaymentDetails('clearance',self.student)
     268        self.assertEqual(error, u'Acceptance Fee payments not allowed.')
     269        IWorkflowState(self.student).setState('cleared')
     270        error, payment = utils.setPaymentDetails('clearance',self.student)
    268271        self.assertEqual(payment.p_level, 100)
    269272        self.assertEqual(payment.p_session, 2004)
     
    403406        self.browser.getControl(name="form.p_category").value = ['schoolfee']
    404407        self.browser.getControl("Create ticket").click()
    405         self.assertMatches('...Payment temporarily disabled...',
     408        self.assertMatches('...This category of payments has been disabled...',
    406409                           self.browser.contents)
    407410        self.certificate.study_mode = 'ug_ft'
  • main/waeup.fceokene/trunk/src/waeup/fceokene/students/utils.py

    r13779 r13800  
    2020from time import time
    2121from zope.component import createObject, getUtility
    22 from waeup.kofa.interfaces import CLEARED, RETURNING, PAID
     22from waeup.kofa.interfaces import (
     23    CLEARED, RETURNING, PAID, ADMITTED, CLEARANCE, REQUESTED)
    2324from kofacustom.nigeria.students.utils import NigeriaStudentsUtils
    2425from waeup.kofa.accesscodes import create_accesscode
     
    113114            except (AttributeError, TypeError):
    114115                return _('Study course data are incomplete.'), None
     116            if student.state not in (ADMITTED, CLEARANCE, REQUESTED, CLEARED):
     117                return _(u'Acceptance Fee payments not allowed.'), None
    115118        elif category == 'third_semester' and student.current_mode == 'nce_ft':
    116119            if student.depcode in ARTS:
     
    270273            return _('This type of payment has already been made.'), None
    271274        if self._isPaymentDisabled(p_session, category, student):
    272             return _('Payment temporarily disabled.'), None
     275            return _('This category of payments has been disabled.'), None
    273276        payment = createObject(u'waeup.StudentOnlinePayment')
    274277        timestamp = ("%d" % int(time()*10000))[1:]
Note: See TracChangeset for help on using the changeset viewer.