Changeset 15210 for main


Ignore:
Timestamp:
31 Oct 2018, 10:30:46 (6 years ago)
Author:
Henrik Bettermann
Message:

Ease customization of AccommodationManageFormPage?.

File:
1 edited

Legend:

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

    r15203 r15210  
    21292129
    21302130    @property
    2131     def actionsgroup1(self):
    2132         if not self.with_hostel_selection:
    2133             return []
     2131    def booking_allowed(self):
    21342132        students_utils = getUtility(IStudentsUtils)
    21352133        acc_details  = students_utils.getAccommodationDetails(self.context.student)
     
    21372135            self.context.student, acc_details)
    21382136        if error_message:
     2137            return False
     2138        return True
     2139
     2140    @property
     2141    def actionsgroup1(self):
     2142        if not self.booking_allowed:
     2143            return []
     2144        if not self.with_hostel_selection:
    21392145            return []
    21402146        return [_('Save')]
     
    21432149    def actionsgroup2(self):
    21442150        if getattr(self.request.principal, 'user_type', None) == 'student':
     2151            ## Book button can be disabled in custom packages by
     2152            ## uncommenting the following lines.
     2153            #if not self.booking_allowed:
     2154            #    return []
    21452155            return [_('Book accommodation')]
    21462156        return [_('Book accommodation'), _('Remove selected')]
Note: See TracChangeset for help on using the changeset viewer.