Ignore:
Timestamp:
10 Dec 2007, 21:50:04 (17 years ago)
Author:
Henrik Bettermann
Message:

calculate correct session_id and layout changes

File:
1 edited

Legend:

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

    r2902 r2913  
    5252review_state = info['review_state'] = s_brain.review_state
    5353
    54 info['session'] = current_session = context.getSessionId()[0]
     54
     55info['session'] = session = context.getSessionId()
    5556
    5657students_object = context.portal_url.getPortalObject().campus.students
     
    6061
    6162booking_allowed = False
    62 if review_state in ('school_fee_paid','courses_registered', 'courses_validated',) and s_brain.session == current_session:
     63if review_state in ('school_fee_paid','courses_registered', 'courses_validated',) and s_brain.session == session[0]:
    6364    booking_allowed = True
    6465
     
    7273    info['acco'] = None
    7374    return info
    74 acco_id = 'accommodation_' + str(current_session)
     75acco_id = 'accommodation_' + session[0]
    7576acco = getattr(student,acco_id,None)
    7677info['acco'] = acco
     
    9192    bt = 'pr'
    9293else:
    93     if s_brain.end_level and s_brain.end_level:
    94         certlevel = int(certificate.end_level)
    95     else:
    96         info["error"] = '"no level information provided","%s"' % c_brain.getId
    97         return info
    98     if s_brain.end_level >= s_brain.end_level:
    99         bt = "fi"
     94    res = context.portal_catalog(portal_type = "Certificate", id = s_brain.course)
     95    if res:
     96        c_brain = res[0]
     97        certificate = c_brain.getObject().getContent()
     98        try:
     99            certlevel = int(certificate.end_level)
     100        except:
     101            info["error"] = '"no end_level for","%s"' % c_brain.getId
     102            return info
     103        try:
     104            studentlevel = int(s_brain.level)
     105        except:
     106            info["error"] = '"no level for","%s"' % s_brain.getId
     107            return info
     108        if studentlevel >= certlevel:
     109            bt = "fi"
    100110d['sex'] = 'male'
    101111if s_brain.sex:
Note: See TracChangeset for help on using the changeset viewer.