Changeset 3164


Ignore:
Timestamp:
14 Feb 2008, 12:29:53 (17 years ago)
Author:
Henrik Bettermann
Message:

resolve #90 fc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/Students.py

    r3146 r3164  
    176176                total_not_imported += 1
    177177                continue
    178             if res.review_state in ('courses_registered','courses_validated'):
     178            student_record = res[0]
     179            if getattr(student_record,'review_state','') in ('courses_registered','courses_validated'):
    179180                em = 'already registered course list'
    180                 logger.info('%s (%s) %s' % (student_brain.id, old_matric_no, em))
     181                logger.info('%s (%s) %s' % (student_record.id, old_matric_no, em))
    181182                result['Error'] = em
    182183                not_imported.append( format_error % result)
    183184                total_not_imported += 1
    184                 continue               
    185             student_brain = res[0]
    186             student_object = getattr(students_folder,student_brain.id)
    187             result['id'] = student_brain.id
     185                continue
     186            student_object = getattr(students_folder,student_record.id)
     187            result['id'] = student_record.id
    188188            cert_id = makeCertificateCode(result.get('study_course'))
    189189            if cert_id not in certs.keys():
     
    204204            if clearance is None:
    205205                em = 'Student has no clearance object'
    206                 logger.info('%s (%s) %s' % (student_brain.id, old_matric_no, em))
     206                logger.info('%s (%s) %s' % (student_record.id, old_matric_no, em))
    207207                result['Error'] = em
    208208                not_imported.append( format_error % result)
     
    229229                if icl == int(old_current_level) and old_study_course == new_study_course:
    230230                    em = 'Already transferred'
    231                     logger.info('%s (%s) %s' % (student_brain.id, old_matric_no, em))
     231                    logger.info('%s (%s) %s' % (student_record.id, old_matric_no, em))
    232232                    result['Error'] = em
    233233                    not_imported.append( format_error % result)
Note: See TracChangeset for help on using the changeset viewer.