Changeset 13233 for main/waeup.kofa/trunk
- Timestamp:
- 27 Aug 2015, 08:37:25 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/root.py
r13226 r13233 97 97 # logger.info( 98 98 # '%s: description_dict added to root.' % self.log_prefix) 99 100 # Add container_code index 99 101 try: 100 102 cat = getUtility(ICatalog, name='applicants_catalog') … … 109 111 pass 110 112 113 # Remove old applicant ids from global role map. 111 114 try: 112 115 removed_applicant_ids = [] … … 128 131 '%s: %s removed from global role map.' 129 132 % (self.log_prefix, removed_applicant_ids)) 133 except ComponentLookupError: # in unit tests 134 pass 135 136 # Remove old student ids from global role map. 137 try: 138 removed_student_ids = [] 139 cat = getUtility(ICatalog, name='students_catalog') 140 role_manager = IPrincipalRoleManager(grok.getSite()) 141 principals = role_manager.getPrincipalsForRole('waeup.Student') 142 for principal in principals: 143 student_id = principal[0] 144 results = cat.searchResults(student_id=(student_id, student_id)) 145 if len(results): 146 continue 147 # The student does no longer exist. 148 nothing_to_do = False 149 role_manager.unsetRoleForPrincipal( 150 'waeup.Student', student_id) 151 removed_student_ids.append(student_id) 152 if len(removed_student_ids): 153 logger.info( 154 '%s: %s removed from global role map.' 155 % (self.log_prefix, removed_student_ids)) 130 156 except ComponentLookupError: # in unit tests 131 157 pass
Note: See TracChangeset for help on using the changeset viewer.