Changeset 2913 for WAeUP_SRP/fceokene/waeup_custom/getAccommodationInfo.py
- Timestamp:
- 10 Dec 2007, 21:50:04 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/fceokene/waeup_custom/getAccommodationInfo.py
r2902 r2913 52 52 review_state = info['review_state'] = s_brain.review_state 53 53 54 info['session'] = current_session = context.getSessionId()[0] 54 55 info['session'] = session = context.getSessionId() 55 56 56 57 students_object = context.portal_url.getPortalObject().campus.students … … 60 61 61 62 booking_allowed = False 62 if review_state in ('school_fee_paid','courses_registered', 'courses_validated',) and s_brain.session == current_session:63 if review_state in ('school_fee_paid','courses_registered', 'courses_validated',) and s_brain.session == session[0]: 63 64 booking_allowed = True 64 65 … … 72 73 info['acco'] = None 73 74 return info 74 acco_id = 'accommodation_' + s tr(current_session)75 acco_id = 'accommodation_' + session[0] 75 76 acco = getattr(student,acco_id,None) 76 77 info['acco'] = acco … … 91 92 bt = 'pr' 92 93 else: 93 if s_brain.end_level and s_brain.end_level: 94 certlevel = int(certificate.end_level) 95 else: 96 info["error"] = '"no level information provided","%s"' % c_brain.getId 97 return info 98 if s_brain.end_level >= s_brain.end_level: 99 bt = "fi" 94 res = context.portal_catalog(portal_type = "Certificate", id = s_brain.course) 95 if res: 96 c_brain = res[0] 97 certificate = c_brain.getObject().getContent() 98 try: 99 certlevel = int(certificate.end_level) 100 except: 101 info["error"] = '"no end_level for","%s"' % c_brain.getId 102 return info 103 try: 104 studentlevel = int(s_brain.level) 105 except: 106 info["error"] = '"no level for","%s"' % s_brain.getId 107 return info 108 if studentlevel >= certlevel: 109 bt = "fi" 100 110 d['sex'] = 'male' 101 111 if s_brain.sex:
Note: See TracChangeset for help on using the changeset viewer.