Changeset 2773


Ignore:
Timestamp:
26 Nov 2007, 22:27:38 (17 years ago)
Author:
joachim
Message:

fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r2772 r2773  
    14451445        if course_id not in self._v_courses.keys():
    14461446            return '', "No course with ID: %s" % course_id
    1447         # id_key = ''
    1448         # for id_key in ('student_id','matric_no'):
    1449         #     id_field = mapping.get(id_key,None)
    1450         #     if id_field is not None:
    1451         #         student_id = id_field
    1452         #         break
    1453         # query = Eq(id_key,id_field)
    1454         # res = self.students_catalog.evalAdvancedQuery(query)
    1455         student_rec = self.students_catalog.getRecordByKey(mapping['student_id'])
    1456         if student_rec is None:
     1447        id_key = ''
     1448        for id_key in ('student_id','matric_no'):
     1449            id_field = mapping.get(id_key,None)
     1450            if id_field is not None:
     1451                student_id = id_field
     1452                break
     1453        query = Eq(id_key,id_field)
     1454        res = self.students_catalog.evalAdvancedQuery(query)
     1455        if not res:
    14571456            return '', "no student with %(id_key)s %(id_field)s" % vars()
     1457        student_rec = res[0]
    14581458        # if id_field != "student_id":
    14591459        #     mapping['student_id'] = res[0].id
Note: See TracChangeset for help on using the changeset viewer.