Changeset 4007 for WAeUP_SRP/trunk/skins/waeup_accommodation
- Timestamp:
- 10 Mar 2009, 06:03:56 (16 years ago)
- Location:
- WAeUP_SRP/trunk/skins/waeup_accommodation
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/skins/waeup_accommodation/getAccommodationInfo.py
r3985 r4007 16 16 import DateTime 17 17 18 booking_disabled = False18 booking_disabled = True 19 19 20 20 request = context.REQUEST … … 56 56 info['student'] = student 57 57 58 # do not change these settings! 59 58 60 booking_allowed = False 61 info['booking_disabled'] = False 59 62 60 63 # customize from here … … 76 79 'courses_validated', 77 80 ) 81 new = None 82 arrived = None 78 83 79 84 try: … … 85 90 except: 86 91 logger.info('%s has invalid session %s' % (student_id,student_record.session)) 87 92 88 93 level = None 89 94 end_level = None … … 117 122 info['acco'] = None 118 123 info['student_status'] = '' 119 logger.info('%s: no bed found' % (student_id))124 logger.info('%s: not eligible' % (student_id)) 120 125 return info 121 122 acco_id = 'accommodation_' + session[0]123 acco = getattr(student,acco_id,None)124 info['acco'] = acco125 info['acco_id'] = acco_id126 bt = 're'127 info['maintenance_paid'] = False128 if acco is not None:129 info['acco_doc'] = acco.getContent()130 info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None)131 info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid"132 elif booking_disabled:133 info['booking_allowed'] = False134 126 135 127 d = {} … … 143 135 else: 144 136 bt = 'fi' 145 146 137 d['sex'] = 'male' 147 138 if student_record.sex: … … 157 148 student_status = "%(sex)s_%(bt)s" % d 158 149 info['student_status'] = student_status 150 151 # customize end 152 153 acco_id = 'accommodation_' + session[0] 154 acco = getattr(student,acco_id,None) 155 info['acco'] = acco 156 info['acco_id'] = acco_id 157 info['maintenance_paid'] = False 158 if acco is not None: 159 info['acco_doc'] = acco.getContent() 160 info['acco_review_state'] = wf.getInfoFor(acco,'review_state',None) 161 info['maintenance_paid'] = info['acco_review_state'] == "maintenance_fee_paid" 162 elif booking_disabled: 163 info['booking_allowed'] = False 164 info['booking_disabled'] = True 165 logger.info('%s: %s eligible but booking disabled' % (student_id,student_status)) 166 159 167 return info -
WAeUP_SRP/trunk/skins/waeup_accommodation/reserve_accommodation.py
r3784 r4007 34 34 35 35 mode = 'create' 36 if info['booking_disabled']: 37 return context.REQUEST.RESPONSE.redirect("%s/booking_disabled" % info['student'].absolute_url()) 36 38 if not info['booking_allowed']: 37 39 return context.REQUEST.RESPONSE.redirect("%s/no_booking_allowed" % info['student'].absolute_url())
Note: See TracChangeset for help on using the changeset viewer.