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

ease disabling hostel booking (not yet tested)

FCE Okene remains unchanged.

File:
1 edited

Legend:

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

    r3960 r4007  
    1515logger = logging.getLogger('Skins.getAccommodationInfo')
    1616import DateTime
     17
     18booking_disabled = True
    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
     
    8287    return info
    8388
    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"
    9489d = {}
    9590if level >= 300:
     
    106101    d['sex'] = 'female'
    107102
    108 
    109103info['sex']=d['sex']
    110104d['bt'] = bt
    111105student_status = "%(sex)s_%(bt)s" % d
    112106info['student_status'] = student_status
     107
     108# customize end
     109
     110acco_id = 'accommodation_' + session[0]
     111acco = getattr(student,acco_id,None)
     112info['acco'] = acco
     113info['acco_id'] = acco_id
     114info['maintenance_paid'] = False
     115if acco is not None:
     116    info['acco_doc'] = acco.getContent()
     117    info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
     118    info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
     119elif booking_disabled:
     120    info['booking_allowed'] = False
     121    info['booking_disabled'] = True
     122    logger.info('%s: %s eligible but booking disabled' % (student_id,student_status)) 
     123
    113124return info
    114125
Note: See TracChangeset for help on using the changeset viewer.