Changeset 3131 for WAeUP_SRP


Ignore:
Timestamp:
8 Feb 2008, 19:56:14 (17 years ago)
Author:
joachim
Message:

should fix the int-traceback, untestet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/uniben/waeup_custom/getAccommodationInfo.py

    r3122 r3131  
    8686arrived = student_record.session == session[0]
    8787previous = int(student_record.session) == int(session[0]) - 1
    88 
    89 if student_record.review_state == 'deactivated':
     88level = None
     89end_level = None
     90try:
     91    level = int(student_record.level)
     92except ValueError:
     93    logger.info('%s has invalid level %s' % (member_id,student_record.level))
     94try:
     95    end_level = int(student_record.end_level)
     96except ValueError:
     97    logger.info('%s has invalid end_level %s' % (member_id,student_record.end_level))
     98   
     99if level is None or end_level is None or student_record.review_state == 'deactivated':
    90100    pass
    91101elif arrived:
     
    93103        booking_allowed = student_record.review_state in new_states
    94104    else:
    95         booking_allowed = not (int(student_record.level) % 100)
     105        booking_allowed = not (level % 100)
    96106elif previous:
    97107    booking_allowed = student_record.verdict in ('A','B',)
     
    121131if new:
    122132    bt = 'fr'
    123 elif int(student_record.level) + delta < int(student_record.end_level):
     133elif level + delta < end_level:
    124134    bt = 're'
    125135else:
     
    146156if student_record.sex:
    147157    d['sex'] = 'female'
    148 if student_record.faculty in ('MED','DEN') and int(student_record.level) > 400:
     158if student_record.faculty in ('MED','DEN') and level > 400:
    149159    bt += "_med"
    150160elif student_record.course in ekehuan_certificates:
Note: See TracChangeset for help on using the changeset viewer.