Changeset 2662


Ignore:
Timestamp:
15 Nov 2007, 07:15:41 (17 years ago)
Author:
Henrik Bettermann
Message:

catch ValueError?: invalid literal for int()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/Students.py

    r2654 r2662  
    218218                total_not_imported += 1
    219219                continue
    220             if icl == int(old_current_level) and old_study_course == new_study_course:
    221                 em = 'Already transferred'
    222                 logger.info('%s (%s) %s' % (student_brain.id, old_matric_no, em))
    223                 result['Error'] = em
    224                 not_imported.append( format_error % result)
    225                 total_not_imported += 1
    226                 continue
     220            try:
     221                icl = int(old_current_level)               
     222                if icl == int(old_current_level) and old_study_course == new_study_course:
     223                    em = 'Already transferred'
     224                    logger.info('%s (%s) %s' % (student_brain.id, old_matric_no, em))
     225                    result['Error'] = em
     226                    not_imported.append( format_error % result)
     227                    total_not_imported += 1
     228                    continue
     229            except:
     230                pass
    227231            if study_course.objectIds():
    228232                em = 'Already registered level %s for %s, but is supposed to study %s at level %s' % (old_current_level,old_study_course,new_study_course,current_level)
Note: See TracChangeset for help on using the changeset viewer.