Changeset 2696 for WAeUP_SRP/base/PatchCPSUserFolderUserFolder.py
- Timestamp:
- 17 Nov 2007, 18:25:29 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/PatchCPSUserFolderUserFolder.py
r2065 r2696 78 78 ## patch to assign dynamic roles for WAeUP 79 79 while 1: 80 #if self.isStudent(): 81 # break 82 # if re.match(r'\D\d\d\d\d\d\d',name): 83 # break 84 #if len(name) != 7: 85 # break 86 #try: 87 # int(name[1:]) 88 #except: 89 # break 80 90 81 o = ord(name[1]) 91 82 if o >= 48 and o <= 57: … … 103 94 "StudentClearance", 104 95 "StudentStudyLevel", 105 "Student CourseResult",96 "StudentPersonal", 106 97 ): 107 98 break 108 109 # don't test if it is not a proxy110 #if real_object.portal_type == real_object.meta_type:111 # break112 113 # can be later simplified by replacing by students_catalog values - Henrik114 # getattr works always because of acquisition ?! Henrik115 # sc = getattr(real_object,'study_course',None)116 # if sc is None:117 # break118 # sc_obj = sc.getContent()119 # cert_id = sc_obj.study_course120 # res_cert = self.portal_catalog(id = cert_id)121 # if len(res_cert) != 1:122 # break123 # certificate_brain = res_cert[0]124 # certificate_obj = certificate_brain.getObject()125 # cert_path = certificate_brain.getPath().split('/')126 # fac_id = cert_path[-4]127 # dep_id = cert_path[-3]128 # temporary self-healing function129 # deprecated after reindexing the students_catalog130 99 student_id = self.getStudentId() 131 100 res = self.students_catalog(id=student_id) … … 133 102 break 134 103 st_entry = res[0] 135 # if st_entry.faculty != fac_id or\ 136 # st_entry.department != dep_id or\ 137 # st_entry.course != cert_id: 138 # self.students_catalog.modifyRecord(id = student_id, 139 # faculty = fac_id, 140 # department = dep_id, 141 # course = cert_id 142 # ) 143 if real_object.portal_type in ("StudentStudyLevel","StudentCourseResult"): 144 # res_cert = self.portal_catalog(id = st_entry.course) 145 # if len(res_cert) != 1: 146 # break 147 # certificate_brain = res_cert[0] 148 # certificate_obj = certificate_brain.getObject() 104 105 if real_object.portal_type in ("StudentStudyLevel"): 149 106 certificate_obj = getCertificateObject(self,st_entry) 150 107 if certificate_obj is None: … … 157 114 if real_object.portal_type == "StudentStudyLevel": 158 115 level = object.getId() 159 elif real_object.portal_type == "StudentCourseResult":160 level = object.aq_parent.getId()161 116 context_obj = getattr(certificate_obj,level,None) 162 117 if context_obj is None:
Note: See TracChangeset for help on using the changeset viewer.