Ignore:
Timestamp:
29 Feb 2016, 17:01:43 (9 years ago)
Author:
Henrik Bettermann
Message:

Customize checkAccommodationRequirements:
Only ug fulltime students are eligible to book accommodation.

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

Legend:

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

    r13749 r13753  
    597597    def test_student_accommodation(self):
    598598        del self.student['accommodation']['2004']
     599        self.student['studycourse'].certificate.study_mode = 'dp_ft'
    599600        # All beds can be assigned
    600601        bed1 = self.app['hostels']['hall-1']['hall-1_A_101_A']
     
    612613        self.browser.open(self.acco_path)
    613614        IWorkflowInfo(self.student).fireTransition('admit')
     615        self.browser.getControl("Book accommodation").click()
     616        self.assertTrue(
     617            'You are not eligible to book accommodation.'
     618            in self.browser.contents)
     619        self.student['studycourse'].certificate.study_mode = 'ug_ft'
    614620        self.browser.getControl("Book accommodation").click()
    615621        self.assertFalse('Activation Code:' in self.browser.contents)
  • main/waeup.aaue/trunk/src/waeup/aaue/students/utils.py

    r13749 r13753  
    330330        return d
    331331
     332    def checkAccommodationRequirements(self, student, acc_details):
     333        super(CustomStudentsUtils, self).checkAccommodationRequirements(
     334            student, acc_details)
     335        if student.current_mode not in ('ug_ft', 'de_ft', 'mug_ft', 'mde_ft'):
     336            return _('You are not eligible to book accommodation.')
     337        return
     338
    332339    # AAUE prefix
    333340    STUDENT_ID_PREFIX = u'E'
Note: See TracChangeset for help on using the changeset viewer.