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_unilorin/getAccommodationInfo.py

    r3690 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
     
    7681    return info
    7782
    78 acco_id = 'accommodation_' + session[0]
    79 acco = getattr(student,acco_id,None)
    80 info['acco'] = acco
    81 info['acco_id'] = acco_id
    82 
    83 info['maintenance_paid'] = False
    84 if acco is not None:
    85     info['acco_doc'] = acco.getContent()
    86     info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
    87     info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
    8883d = {}
    8984if level >= 300:
     
    105100student_status = "%(sex)s_%(bt)s" % d
    106101info['student_status'] = student_status
     102
     103# customize end
     104
     105acco_id = 'accommodation_' + session[0]
     106acco = getattr(student,acco_id,None)
     107info['acco'] = acco
     108info['acco_id'] = acco_id
     109info['maintenance_paid'] = False
     110if acco is not None:
     111    info['acco_doc'] = acco.getContent()
     112    info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)
     113    info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"
     114elif booking_disabled:
     115    info['booking_allowed'] = False
     116    info['booking_disabled'] = True
     117    logger.info('%s: %s eligible but booking disabled' % (student_id,student_status))
     118   
    107119return info
    108120
Note: See TracChangeset for help on using the changeset viewer.