Ignore:
Timestamp:
4 Nov 2012, 08:04:15 (12 years ago)
Author:
Henrik Bettermann
Message:

Rename is_fresh method. Actually we need to filter students who have not yet paid school fee.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r9518 r9521  
    14001400
    14011401    def update(self):
    1402         if self.context.student.is_fresh:
    1403             self.flash(_("You can't pay for a session below your entry session."))
     1402        if self.context.student.before_payment:
     1403            self.flash(_("No previous payment to be made."))
    14041404            self.redirect(self.url(self.context))
    14051405        super(PreviousPaymentAddFormPage, self).update()
  • main/waeup.kofa/trunk/src/waeup/kofa/students/student.py

    r9517 r9521  
    3737    IObjectHistory, IUserAccount, IFileStoreNameChooser, IFileStoreHandler,
    3838    IKofaUtils, registration_states_vocab, IExtFileStore,
    39     CLEARANCE)
     39    CLEARANCE, PAID, REGISTERED, VALIDATED, RETURNING)
    4040from waeup.kofa.students.accommodation import StudentAccommodation
    4141from waeup.kofa.students.export import EXPORTER_NAMES
     
    193193
    194194    @property
    195     def is_fresh(self):
     195    def before_payment(self):
    196196        entry_session = getattr(
    197197            self.get('studycourse', None), 'entry_session', None)
    198         if self.current_session == entry_session:
     198        non_fresh_states = (PAID, REGISTERED, VALIDATED, RETURNING, )
     199        if self.current_session == entry_session and \
     200            self.state not in non_fresh_states:
    199201            return True
    200202        return False
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9519 r9521  
    21992199        self.assertFalse(self.student['payments'][value].p_current)
    22002200
    2201         # Button and form are not available for fresh students
     2201        # Button and form are not available for students who are in
     2202        # states up to cleared
    22022203        self.student['studycourse'].entry_session = 2004
     2204        IWorkflowState(self.student).setState('cleared')
    22032205        self.browser.open(self.payments_path)
    22042206        self.assertFalse(
     
    22062208        self.browser.open(self.payments_path + '/addpp')
    22072209        self.assertTrue(
    2208             "You can't pay for a session below your entry session" in
    2209             self.browser.contents)
     2210            "No previous payment to be made" in self.browser.contents)
    22102211        return
    22112212
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r9519 r9521  
    335335        if academic_session == None:
    336336            return _(u'Session configuration object is not available.'), None
     337        # Determine fee.
    337338        if category == 'schoolfee':
    338339            try:
  • main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py

    r9517 r9521  
    611611    def target_url(self):
    612612        student = self.view.context.student
    613         if student.is_fresh:
     613        if student.before_payment:
    614614            return ''
    615615        return self.view.url(self.view.context, self.target)
Note: See TracChangeset for help on using the changeset viewer.