Changeset 3452 for WAeUP_SRP/base/skins/waeup_student/getClearanceInfo.py
- Timestamp:
- 19 Apr 2008, 09:19:02 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_student/getClearanceInfo.py
r2975 r3452 12 12 return Info about the current Student 13 13 """ 14 try: 15 from Products.zdb import set_trace 16 except: 17 def set_trace(): 18 pass 14 19 import logging 15 20 logger = logging.getLogger('Skins.getClearanceInfo') … … 42 47 return None 43 48 49 student_record = context.students_catalog.getRecordByKey(student_id) 44 50 students_object = context.portal_url.getPortalObject().campus.students 45 51 student = getattr(students_object, student_id) 46 res = context.portal_catalog(portal_type='Student',id = student_id) 47 if len(res) == 0: 48 return None 49 creation_date = DateTime(res[0].CreationDate) 50 info['penalty'] = creation_date.lessThan(DateTime('2006/12/5')) 52 # res = context.portal_catalog(portal_type='Student',id = student_id) 53 # if len(res) == 0: 54 # return None 55 # creation_date = DateTime(res[0].CreationDate) 56 # info['penalty'] = creation_date.lessThan(DateTime('2006/12/5')) 57 info['penalty'] = False 51 58 info['id'] = student_id 52 59 info['student'] = student 53 info['review_state'] = context.getStudentReviewState() 54 info['app'] = student.application 60 info['student_name'] = student_record.name 61 #info['review_state'] = context.getStudentReviewState() 62 info['review_state'] = student_record.review_state 63 # info['app'] = student.application 55 64 info['app_doc'] = student.application.getContent() 56 65 info['clear'] = student.clearance … … 59 68 info['per'] = student.personal 60 69 info['per_review_state'] = wf.getInfoFor(student.personal,'review_state',None) 61 if info['review_state'] in ('clearance_requested', 'cleared_and_validated',): 62 info['penalty'] = info['penalty'] and\ 63 info['clear_doc'].entry_date.greaterThan(DateTime('2006/12/30')) 64 course = getattr(student,'study_course',None) 65 if course: 66 cert_id = course.getContent().study_course 67 res = context.portal_catalog(portal_type = "Certificate", id = cert_id) 68 ci = {} 69 if len(res) > 0: 70 info['course'] = course 71 brain = res[0] 72 ci['study_course'] = brain.getId 73 ci['title'] = brain.Title 74 pl = brain.getPath().split('/') 75 ci['faculty'] = pl[-4] 76 ci['department'] = pl[-3] 77 info['course_doc'] = ci 78 else: 79 info['course'] = None 70 ci = {} 71 ci['course'] = student_record.course 72 ci['faculty'] = student_record.faculty 73 ci['department'] = student_record.department 74 info['course_doc'] = ci 75 # if info['review_state'] in ('clearance_requested', 'cleared_and_validated',): 76 # info['penalty'] = info['penalty'] and\ 77 # info['clear_doc'].entry_date.greaterThan(DateTime('2006/12/30')) 78 # course = getattr(student,'study_course',None) 79 # if course: 80 # cert_id = course.getContent().study_course 81 # res = context.portal_catalog(portal_type = "Certificate", id = cert_id) 82 # ci = {} 83 # if len(res) > 0: 84 # info['course'] = course 85 # brain = res[0] 86 # ci['study_course'] = brain.getId 87 # ci['title'] = brain.Title 88 # pl = brain.getPath().split('/') 89 # ci['faculty'] = pl[-4] 90 # ci['department'] = pl[-3] 91 # info['course_doc'] = ci 92 # else: 93 # info['course'] = None 80 94 return info
Note: See TracChangeset for help on using the changeset viewer.