Changeset 741


Ignore:
Timestamp:
21 Oct 2006, 14:15:01 (18 years ago)
Author:
joachim
Message:

anotherway to find the student_id

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/getStudentInfo.py

    r739 r741  
    2020path_info = request.get('PATH_INFO').split('/')
    2121roles = member.getRoles()
     22
    2223info = {}
    2324info['is_manager'] = context.isManager()
     
    2526member_id = str(member)
    2627if student is None:
    27     if context.isManager() and 'students' in context.getPhysicalPath():
    28         if context.portal_type == 'Student':
    29             student_id = context.getId()
    30         elif context.aq_parent.portal_type == 'Student':
    31             student_id = context.aq_parent.getId()
    32         elif context.aq_parent.aq_parent.portal_type == 'Student':
    33             student_id = context.aq_parent.aq_parent.getId()
    34         elif context.aq_parent.aq_parent.aq_parent.portal_type == 'Student':
    35             student_id = context.aq_parent.aq_parent.aq_parent.getId()
    36         else:
    37             student_id = member_id
     28    if context.isManager() and 'students' in path_info:
     29        student_id = path_info[path_info.index('students')+1]
     30##        if context.portal_type == 'Student':
     31##            student_id = context.getId()
     32##        elif context.aq_parent.portal_type == 'Student':
     33##            student_id = context.aq_parent.getId()
     34##        elif context.aq_parent.aq_parent.portal_type == 'Student':
     35##            student_id = context.aq_parent.aq_parent.getId()
     36##        elif context.aq_parent.aq_parent.aq_parent.portal_type == 'Student':
     37##            student_id = context.aq_parent.aq_parent.aq_parent.getId()
     38##        else:
     39##            student_id = member_id
    3840    else:
    3941        student_id = member_id
Note: See TracChangeset for help on using the changeset viewer.