- Timestamp:
- 4 Feb 2008, 15:44:24 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/fceokene/waeup_custom/getStudyLevelInfo.py
r2836 r3105 11 11 """ 12 12 return Info about the Studylevel 13 """14 15 wf = context.portal_workflow16 mtool = context.portal_membership17 if mtool.isAnonymousUser():18 return None19 member = mtool.getAuthenticatedMember()20 member_id = str(member)21 22 13 try: 23 14 from Products.zdb import set_trace … … 25 16 def set_trace(): 26 17 pass 18 """ 27 19 20 info = context.waeup_tool.getAccessInfo(context) 21 student_id = info['student_id'] 22 if student_id is None: 23 return None 28 24 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 25 mtool = context.portal_membership 26 member = mtool.getAuthenticatedMember() 27 member_id = str(member) 28 34 29 course_results = context.course_results 35 30 request = context.REQUEST … … 38 33 logger = logging.getLogger('Skins.getStudyLevelInfo') 39 34 40 info = {}41 42 student_id = context.getStudentId()43 35 level_id = context.getId() 44 36 level_doc = info['doc'] = context.getContent() 45 37 46 info['is_so'] = is_so = context.isSectionOfficer()47 info['is_student'] = is_student = context.isStudent()38 info['is_so'] = is_so = info['is_sectionofficer'] 39 #info['is_student'] = is_student = context.isStudent() 48 40 info['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] 42 info['student'] = student = context.students_catalog.getRecordByKey(student_id) 50 43 info['review_state'] = review_state = student.review_state 51 44 is_current_level = level_id == student.level … … 60 53 61 54 info['show_check_boxes'] = (is_ca and school_fee_paid and is_current_level and not has_verdict) or\ 62 (i s_studentand 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\ 63 56 (is_so and is_current_level and not has_verdict) 64 57 … … 92 85 93 86 max_credits = 58 94 #if context.getId() == student.end_level: 95 # max_credits = 51 87 info['without_score'] = without_score = False 96 88 97 89 #end customization … … 104 96 if gpa and total_credits: 105 97 info['gpa'] = "%4.2f" % (float(gpa)/int(total_credits)) 106 107 108 98 109 99 # carry_overs.sort(cmp_semester_id)
Note: See TracChangeset for help on using the changeset viewer.