- Timestamp:
- 25 Jan 2008, 14:45:17 (17 years ago)
- Location:
- WAeUP_SRP/uniben
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/uniben/profiles/default/vocabularies/acco_special_handling.xml
r1449 r3048 8 8 <item key="no" msgid="">---</item> 9 9 <item key="pg" msgid="">Postgraduate</item> 10 <item key=" med" msgid="">Medical (Level 500/600)</item>10 <item key="no_med" msgid="">Medical (Level 500/600)</item> 11 11 <item key="no_ekenhuan" msgid="">Ekenhuan Campus</item> 12 12 <item key="no_pti" msgid="">PTI</item> -
WAeUP_SRP/uniben/waeup_custom/getAccommodationInfo.py
r2914 r3048 35 35 else: 36 36 student_id = member_id 37 res = context.students_catalog(id=student_id)38 if len(res) != 1:37 student_record = context.students_catalog.getRecordByKey(student_id) 38 if student_record is None: 39 39 logger.info('%s not found in students_catalog' % student_id) 40 40 return None … … 57 57 'BENGMEP', 58 58 ) 59 s_brain = res[0]60 59 info['error'] = None 61 info['matric_no']=s _brain.matric_no62 info['jamb_reg_no']=s _brain.jamb_reg_no63 info['name']=s _brain.name64 info['email']=s _brain.email65 info['level']=s _brain.level66 info['verdict']=getattr(s _brain,'verdict','')67 review_state = info['review_state'] = s _brain.review_state60 info['matric_no']=student_record.matric_no 61 info['jamb_reg_no']=student_record.jamb_reg_no 62 info['name']=student_record.name 63 info['email']=student_record.email 64 info['level']=student_record.level 65 info['verdict']=getattr(student_record,'verdict','') 66 review_state = info['review_state'] = student_record.review_state 68 67 69 68 info['session'] = session = context.getSessionId() … … 75 74 76 75 booking_allowed = False 77 if review_state in ('cleared_and_validated','returning','school_fee_paid','courses_registered', 'courses_validated',) and s _brain.session == session[0]:76 if review_state in ('cleared_and_validated','returning','school_fee_paid','courses_registered', 'courses_validated',) and student_record.session == session[0]: 78 77 booking_allowed = True 79 if s _brain.matric_no:80 res = context.results_import(matric_no = s _brain.matric_no)78 if student_record.matric_no: 79 res = context.results_import(matric_no = student_record.matric_no) 81 80 if res: 82 81 booking_allowed = info['verdict'] in ("A", … … 88 87 if not booking_allowed: 89 88 info['acco'] = None 90 return info89 # return info 91 90 92 91 acco_id = 'accommodation_' + session[0] … … 105 104 if review_state == "cleared_and_validated": 106 105 bt = 'fr' 107 elif int(s_brain.level) < 300: 106 elif int(student_record.level) < 100: 107 bt = 'pr' 108 elif int(student_record.level) < int(student_record.end_level): 108 109 bt = 're' 109 elif int(s_brain.level) < 100:110 bt = 'pr'111 elif s_brain.faculty in ('MED') and int(s_brain.level) >= 400:112 bt = "med"113 110 else: 114 res = context.portal_catalog(portal_type = "Certificate", id = s_brain.course) 115 if res: 116 c_brain = res[0] 117 #from Products.zdb import set_trace; set_trace() 118 certificate = c_brain.getObject().getContent() 119 try: 120 certlevel = int(certificate.end_level) 121 except: 122 info["error"] = '"no end_level for","%s"' % c_brain.getId 123 return info 124 try: 125 studentlevel = int(s_brain.level) 126 except: 127 info["error"] = '"no level for","%s"' % s_brain.getId 128 return info 129 if studentlevel >= certlevel: 130 bt = "fi" 111 bt = 'fi' 112 # else: 113 # res = context.portal_catalog(portal_type = "Certificate", id = student_record.course) 114 # if res: 115 # c_brain = res[0] 116 # #from Products.zdb import set_trace; set_trace() 117 # certificate = c_brain.getObject().getContent() 118 # try: 119 # certlevel = int(certificate.end_level) 120 # except: 121 # info["error"] = '"no end_level for","%s"' % c_brain.getId 122 # return info 123 # try: 124 # studentlevel = int(student_record.level) 125 # except: 126 # info["error"] = '"no level for","%s"' % student_record.getId 127 # return info 128 # if studentlevel >= certlevel: 129 # bt = "fi" 131 130 d['sex'] = 'male' 132 if s _brain.sex:131 if student_record.sex: 133 132 d['sex'] = 'female' 134 if s_brain.course in ekehuan_certificates: 133 if student_record.faculty in ('MED') and int(student_record.level) > 400: 134 bt += "_med" 135 elif student_record.course in ekehuan_certificates: 135 136 bt += "_ekenhuan" 136 elif s _brain.course in pti_certificates:137 elif student_record.course in pti_certificates: 137 138 bt += "_pti" 138 139 … … 142 143 143 144 d['bt'] = bt 144 #from Products.zdb import set_trace145 #set_trace()146 145 student_status = "%(sex)s_%(bt)s" % d 147 146 info['student_status'] = student_status
Note: See TracChangeset for help on using the changeset viewer.