Ignore:
Timestamp:
10 Mar 2009, 08:03:23 (16 years ago)
Author:
Henrik Bettermann
Message:

ease disabling hostel booking also for fceokene

Location:
WAeUP_SRP/trunk/skins/waeup_fceokene
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_fceokene/getAccommodationInfo.py

    r3960 r4009  
    1515logger = logging.getLogger('Skins.getAccommodationInfo')
    1616import DateTime
     17
     18booking_disabled = False
    1719
    1820request = context.REQUEST
     
    5456info['student'] = student
    5557
     58# do not change these settings!
     59
    5660booking_allowed = False
     61info['booking_disabled'] = False
    5762
    5863# customize from here
     
    8085    info['booking_allowed'] = False
    8186    info['student_status'] = ''
     87    logger.info('%s: not eligible' % (student_id)) 
    8288    return info
    8389
    84 acco_id = 'accommodation_' + session[0]
    85 acco = getattr(student,acco_id,None)
    86 info['acco'] = acco
    87 info['acco_id'] = acco_id
    88 
    89 info['maintenance_paid'] = False
    90 if acco is not None:
    91     info['acco_doc'] = acco.getContent()
    92     info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
    93     info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
    9490d = {}
    9591if level >= 300:
     
    111107student_status = "%(sex)s_%(bt)s" % d
    112108info['student_status'] = student_status
     109
     110# customize end
     111
     112acco_id = 'accommodation_' + session[0]
     113acco = getattr(student,acco_id,None)
     114info['acco'] = acco
     115info['acco_id'] = acco_id
     116info['maintenance_paid'] = False
     117if acco is not None:
     118    info['acco_doc'] = acco.getContent()
     119    info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
     120    info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
     121elif booking_disabled:
     122    info['booking_disabled'] = True
     123    logger.info('%s: %s eligible but booking disabled' % (student_id,student_status)) 
     124
    113125return info
    114126
  • WAeUP_SRP/trunk/skins/waeup_fceokene/reserve_accommodation.py

    r3772 r4009  
    99"""
    1010process the the accommodation reservation
     11customized for FCE Okene (random booking order)
    1112"""
    1213try:
     
    3435
    3536mode = 'create'
     37if info['booking_disabled']:
     38    return context.REQUEST.RESPONSE.redirect("%s/booking_disabled" % info['student'].absolute_url())
    3639if not info['booking_allowed']:
    3740    return context.REQUEST.RESPONSE.redirect("%s/no_booking_allowed" % info['student'].absolute_url())
Note: See TracChangeset for help on using the changeset viewer.