Changeset 15398


Ignore:
Timestamp:
29 Apr 2019, 16:33:50 (6 years ago)
Author:
Henrik Bettermann
Message:

Show different warming message if late course registration fee is not set.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py

    r15378 r15398  
    154154            return
    155155        try:
     156            academic_session = grok.getSite()['configuration'][
     157                str(self.level_session)]
    156158            if self.student.is_postgrad:
    157                 deadline = grok.getSite()['configuration'][
    158                         str(self.level_session)].coursereg_deadline_pg
     159                deadline = academic_session.coursereg_deadline_pg
    159160            elif self.student.current_mode.startswith('dp'):
    160                 deadline = grok.getSite()['configuration'][
    161                         str(self.level_session)].coursereg_deadline_dp
     161                deadline = academic_session.coursereg_deadline_dp
    162162            elif self.student.current_mode.endswith('_pt'):
    163                 deadline = grok.getSite()['configuration'][
    164                         str(self.level_session)].coursereg_deadline_pt
     163                deadline = academic_session.coursereg_deadline_pt
    165164            elif self.student.current_mode == 'found':
    166                 deadline = grok.getSite()['configuration'][
    167                         str(self.level_session)].coursereg_deadline_found
     165                deadline = academic_session.coursereg_deadline_found
    168166            else:
    169                 deadline = grok.getSite()['configuration'][
    170                         str(self.level_session)].coursereg_deadline
     167                deadline = academic_session.coursereg_deadline
    171168        except (TypeError, KeyError):
    172169            return
    173170        if not deadline or deadline > datetime.now(pytz.utc):
    174171            return
     172        if self.student.is_postgrad:
     173            lcrfee = academic_session.late_pg_registration_fee
     174        else:
     175            lcrfee = academic_session.late_registration_fee
     176        if not lcrfee:
     177            return _("Course registration has been disabled.")
    175178        if len(self.student['payments']):
    176179            for ticket in self.student['payments'].values():
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py

    r15388 r15398  
    655655        self.browser.getControl("Create ticket").click()
    656656        self.student['payments'].values()[0].approveStudentPayment()
    657         # Make late registration fee fee payment
     657        # Make late registration fee payment
    658658        self.student['studycourse'].current_session = 2004
    659659        self.browser.open(self.payments_path + '/addop')
     
    673673        self.browser.getLink("Edit course list").click()
    674674        self.assertFalse('<td>67</td>' in self.browser.contents)
     675        self.app['configuration']['2004'].late_registration_fee = 0.0
    675676        self.browser.getControl("Register course list").click()
    676 
    677         ######################################################
    678         # Temporarily disabled ug_ft course registration
    679         #self.assertTrue('Course registration has been disabled'
    680         #    in self.browser.contents)
    681         #return
    682         ######################################################
    683 
     677        self.assertTrue('Course registration has been disabled.' in self.browser.contents)
     678        self.app['configuration']['2004'].late_registration_fee = 345.0
     679        self.browser.getControl("Register course list").click()
    684680        self.assertTrue('Course registration has ended. Please pay' in self.browser.contents)
    685681        self.student['payments'].values()[1].approve()
Note: See TracChangeset for help on using the changeset viewer.