Changeset 3087 for WAeUP_SRP/uniben


Ignore:
Timestamp:
2 Feb 2008, 11:04:55 (17 years ago)
Author:
joachim
Message:

simplyfied logic for booking_allowed,
added test_getAccommodationInfo more testcases must be added

File:
1 edited

Legend:

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

    r3085 r3087  
    8383booking_allowed = False
    8484
    85 new = student_record.entry_session == session[0]
    86 arrived = student_record.session == session[0]
     85# new = student_record.entry_session == session[0]
     86# arrived = student_record.session == session[0]
    8787
    88 if new and arrived and student_record.review_state in new_states:
    89     booking_allowed = True
    90 elif arrived:
    91     dummy,on_probation = divmod(int(student_record.level),100)
    92     if not on_probation:
    93         booking_allowed = True
     88# if new and arrived and student_record.review_state in new_states:
     89#     booking_allowed = True
     90# elif arrived:
     91#     dummy,on_probation = divmod(int(student_record.level),100)
     92#     if not on_probation:
     93#         booking_allowed = True
     94# elif int(student_record.session) == int(session[0]) - 1:
     95#     if student_record.verdict in ('A','B',):
     96#         booking_allowed = True
     97if student_record.session == session[0]:
     98    if student_record.entry_session == session[0]:
     99        booking_allowed = student_record.review_state in new_states
     100    else:
     101        booking_allowed = not (int(student_record.level) % 100)
    94102elif int(student_record.session) == int(session[0]) - 1:
    95     if student_record.verdict in ('A','B',):
    96         booking_allowed = True
     103    booking_allowed = student_record.verdict in ('A','B',)
    97104   
    98105info['booking_allowed'] = booking_allowed
     
    147154#elif student_record.course in pti_certificates:
    148155#    bt += "_pti"
    149 
    150 
    151156info['sex']=d['sex']
    152 
    153 
    154157d['bt'] = bt
    155158student_status = "%(sex)s_%(bt)s" % d
Note: See TracChangeset for help on using the changeset viewer.