Changeset 2776
- Timestamp:
- 26 Nov 2007, 22:56:37 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/WAeUPTool.py
r2775 r2776 1456 1456 return '', "no student with %(id_key)s %(id_field)s" % vars() 1457 1457 student_rec = res[0] 1458 #if id_field != "student_id":1459 # mapping['student_id'] = res[0].id1458 if id_field != "student_id": 1459 mapping['student_id'] = student_rec.id 1460 1460 student_id = student_rec.id 1461 1461 level_id = mapping['level_id'] … … 1504 1504 # if course_id not in self._v_courses.keys(): 1505 1505 # return '', "No course with ID: %s" % did 1506 # id_key = '' 1507 # for id_key in ('student_id','matric_no'): 1508 # id_field = mapping.get(id_key,None) 1509 # if id_field is not None: 1510 # student_id = id_field 1511 # break 1512 # query = Eq(id_key,id_field) 1513 # res = self.students_catalog.evalAdvancedQuery(query) 1514 # if not res: 1515 # return '', "No student with %(id_field)s: %(id_key)s" % vars() 1516 # if id_field != "student_id": 1517 # mapping['student_id'] = res[0].id 1518 students_folder = self.portal_url.getPortalObject().campus.students 1519 student_rec = self.students_catalog.getRecordByKey(mapping['student_id']) 1520 if student_rec is None: 1506 id_key = '' 1507 for id_key in ('student_id','matric_no'): 1508 id_field = mapping.get(id_key,None) 1509 if id_field is not None: 1510 student_id = id_field 1511 break 1512 query = Eq(id_key,id_field) 1513 res = self.students_catalog.evalAdvancedQuery(query) 1514 if not res: 1515 return '', "No student with %(id_field)s: %(id_key)s" % vars() 1516 if id_field != "student_id": 1517 mapping['student_id'] = res[0].id 1518 if not res: 1521 1519 return '', "no student with %(id_key)s %(id_field)s" % vars() 1520 student_rec = res[0] 1522 1521 student_id = student_rec.id 1523 1522 level_id = mapping['level_id']
Note: See TracChangeset for help on using the changeset viewer.