Ignore:
Timestamp:
28 Jan 2019, 11:19:24 (6 years ago)
Author:
Henrik Bettermann
Message:

Allow hostel booking if current session bed ticket has expired.

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

Legend:

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

    r15268 r15307  
    736736    def test_edit_level_by_co(self):
    737737        # Create clearance officer
    738         self.app['users'].addUser('mrclear', 'mrclearsecret')
     738        self.app['users'].addUser('mrclear', 'mrClearsecret1')
    739739        self.app['users']['mrclear'].email = 'mrclear@foo.ng'
    740740        self.app['users']['mrclear'].title = 'Carlo Pitter'
     
    749749        self.browser.open(self.login_path)
    750750        self.browser.getControl(name="form.login").value = 'mrclear'
    751         self.browser.getControl(name="form.password").value = 'mrclearsecret'
     751        self.browser.getControl(name="form.password").value = 'mrClearsecret1'
    752752        self.browser.getControl("Login").click()
    753753        self.assertMatches('...You logged in...', self.browser.contents)
     
    890890    def test_handle_clearance_by_co(self):
    891891        # Create clearance officer
    892         self.app['users'].addUser('mrclear', 'mrclearsecret')
     892        self.app['users'].addUser('mrclear', 'mrClearsecret1')
    893893        self.app['users']['mrclear'].email = 'mrclear@foo.ng'
    894894        self.app['users']['mrclear'].title = 'Carlo Pitter'
     
    902902        self.browser.open(self.login_path)
    903903        self.browser.getControl(name="form.login").value = 'mrclear'
    904         self.browser.getControl(name="form.password").value = 'mrclearsecret'
     904        self.browser.getControl(name="form.password").value = 'mrClearsecret1'
    905905        self.browser.getControl("Login").click()
    906906        self.assertMatches('...You logged in...', self.browser.contents)
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r15268 r15307  
    8181                'A', 'B', 'F', 'J', 'M', 'C', 'Z'):
    8282            return _("Your are not eligible to book accommodation.")
    83         if str(acc_details[
    84             'booking_session']) in student['accommodation'].keys():
     83        bsession = str(acc_details['booking_session'])
     84        if bsession in student['accommodation'].keys() \
     85            and not 'booking expired' in \
     86            student['accommodation'][bsession].bed_coordinates:
    8587            return _('You already booked a bed space in '
    8688                     'current accommodation session.')
Note: See TracChangeset for help on using the changeset viewer.