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

Add 'No favoured hostel' option.

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

Legend:

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

    r15277 r15312  
    21652165    @property
    21662166    def desired_hostel(self):
     2167        if self.context.desired_hostel == 'no':
     2168            return _('No favoured hostel')
    21672169        if self.context.desired_hostel:
    21682170            hostel = grok.getSite()['hostels'].get(self.context.desired_hostel)
     
    21752177        """
    21762178        yield(dict(name=None, title='--', selected=''))
     2179        selected = ''
     2180        if self.context.desired_hostel == 'no':
     2181          selected = 'selected'
     2182        yield(dict(name='no', title=_('No favoured hostel'), selected=selected))
    21772183        for val in grok.getSite()['hostels'].values():
    21782184            selected = ''
  • main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py

    r15306 r15312  
    655655        sorted_beds = sorted(available_beds,
    656656                key=lambda bed: 1000 * bed.__parent__.sort_id + bed.bed_number)
    657         if desired_hostel:
     657        if desired_hostel and desired_hostel != 'no':
    658658            # Filter desired hostel beds
    659659            filtered_beds = [bed for bed in sorted_beds
Note: See TracChangeset for help on using the changeset viewer.