Ignore:
Timestamp:
29 Jan 2019, 21:47:26 (6 years ago)
Author:
Henrik Bettermann
Message:

Do only allow adding bed_allocation payments if desired_hostel is set.

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

    r15307 r15314  
    682682
    683683        self.certificate.study_mode = 'pg_ft'
     684        error, payment = utils.setPaymentDetails('bed_allocation',
     685            self.student, None, None)
     686        self.assertEqual(error, u'Select your favoured hostel first.')
     687        self.student['accommodation'].desired_hostel = u'no'
    684688        error, payment = utils.setPaymentDetails('bed_allocation',
    685689            self.student, None, None)
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r15307 r15314  
    238238            p_item = self.getAccommodationDetails(student)['bt']
    239239            desired_hostel = student['accommodation'].desired_hostel
    240             if desired_hostel:
     240            if not desired_hostel:
     241                return _(u'Select your favoured hostel first.'), None
     242            if desired_hostel and desired_hostel != 'no':
    241243                p_item = u'%s (%s)' % (p_item, desired_hostel)
    242244            amount = academic_session.booking_fee
Note: See TracChangeset for help on using the changeset viewer.