Changeset 3101 for WAeUP_SRP/uniben


Ignore:
Timestamp:
4 Feb 2008, 12:45:36 (17 years ago)
Author:
joachim
Message:

implement getAccessInfo to avoid tracebacks

File:
1 edited

Legend:

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

    r2965 r3101  
    1212return Info about the Studylevel
    1313"""
    14 
    15 wf = context.portal_workflow
    16 mtool = context.portal_membership
    17 if mtool.isAnonymousUser():
    18     return None
    19 member = mtool.getAuthenticatedMember()
    20 member_id = str(member)
    21 
    2214try:
    2315    from Products.zdb import set_trace
     
    2618        pass
    2719
     20info = context.waeup_tool.getAccessInfo(context)
     21student_id = info['student_id']
     22if student_id is None:
     23    return None
    2824
    29 # from Products.AdvancedQuery import Eq, Between, Le,In
    30 # try:
    31 #     aq_portal = context.portal_catalog.evalAdvancedQuery
    32 # except:
    33 #     aq_portal = context.portal_catalog_real.evalAdvancedQuery
     25mtool = context.portal_membership
     26member = mtool.getAuthenticatedMember()
     27member_id = str(member)
     28
    3429course_results = context.course_results
    3530request = context.REQUEST
     
    3833logger = logging.getLogger('Skins.getStudyLevelInfo')
    3934
    40 info = {}
    41 
    42 student_id = context.getStudentId()
    4335level_id  =  context.getId()
    4436level_doc = info['doc'] = context.getContent()
    4537
    46 info['is_so'] = is_so = context.isSectionOfficer()
    47 info['is_student'] = is_student = context.isStudent()
     38info['is_so'] = is_so = info['is_sectionofficer']
     39#info['is_student'] = is_student = context.isStudent()
    4840info['is_ca'] = is_ca = context.isCourseAdviser()
    49 info['student'] = student = context.students_catalog(id=student_id)[0]
     41#info['student'] = student = context.students_catalog(id=student_id)[0]
     42info['student'] = student = context.students_catalog.getRecordByKey(student_id)
    5043info['review_state'] = review_state = student.review_state
    5144is_current_level = level_id == student.level
     
    6053
    6154info['show_check_boxes'] =  (is_ca and school_fee_paid and is_current_level and not has_verdict) or\
    62                             (is_student and school_fee_paid and is_current_level and not has_verdict) or\
     55                            (info['is_student'] and school_fee_paid and is_current_level and not has_verdict) or\
    6356                            (is_so and is_current_level and not has_verdict)
    6457
Note: See TracChangeset for help on using the changeset viewer.