Changeset 16235 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 14 Sep 2020, 06:28:19 (4 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/browser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r16234 r16235 398 398 # Redirect some officers after login 399 399 local_roles = get_user_account(self.request).getLocalRoles() 400 site_roles = get_user_account(self.request).roles 400 401 if local_roles.has_key('waeup.local.Lecturer'): 401 402 self.redirect(self.application_url() + '/my_courses') 402 403 return 403 if local_roles.has_key('waeup.local.TranscriptOfficer'): 404 if local_roles.has_key('waeup.local.TranscriptOfficer') \ 405 or 'waeup.TranscriptOfficer' in site_roles: 404 406 self.redirect(self.application_url() + '/my_transcript_requests') 405 407 return … … 1113 1115 state=(SUBMITTED, SUBMITTED)) 1114 1116 local_roles = self.local_roles.get('waeup.local.TranscriptOfficer', []) 1117 submission_date = '' 1118 for applicant in results: 1119 if 'submitted' in applicant.history.messages[-1]: 1120 submission_date = applicant.history.messages[-1][0:10] 1121 applicants.append((applicant, submission_date)) 1122 # Filter applicants with repect to officer's local role in faculties. 1115 1123 if not local_roles: 1116 return results 1124 return applicants 1125 filtered_applicants = [] 1117 1126 for item in local_roles: 1118 1127 if isinstance(item, Faculty): … … 1120 1129 else: 1121 1130 continue 1122 for applicant in results: 1123 course = getattr(applicant, 'course_studied', None) 1124 if not course: 1131 for applicant in applicants: 1132 course = getattr(applicant[0], 'course_studied', None) 1133 if course is None: 1134 filtered_applicants.append(applicant) 1125 1135 continue 1126 1136 try: 1127 1137 if course.__parent__.__parent__.__parent__.code == faccode: 1128 applicants.append(applicant)1138 filtered_applicants.append(applicant) 1129 1139 except AttributeError: 1130 1140 continue 1131 return applicants1141 return filtered_applicants 1132 1142 1133 1143 class TranscriptSigneeLandingPage(KofaPage): -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/mytranscriptrequests.pt
r16234 r16235 8 8 <th i18n:translate="">Applicant Id</th> 9 9 <th i18n:translate="">Full Name</th> 10 <th i18n:translate="">Course Studied</th> 11 <th i18n:translate="">Submission Date</th> 10 12 </tr> 11 13 </thead> 12 14 <tbody> 13 15 <tr tal:repeat="item view/getApplicants"> 14 <td> <a tal:attributes="href python:view.url(item )">15 <span tal:content=" item/applicant_id">XXXX_1234</span></a>16 <td> <a tal:attributes="href python:view.url(item[0])"> 17 <span tal:content="python:item[0].applicant_id">XXXX_1234</span></a> 16 18 </td> 17 <td tal:content="item/display_fullname">Bob</td> 19 <td tal:content="python:item[0].display_fullname">Bob</td> 20 <td tal:content="python:getattr(item[0].course_studied,'title',None)">Bob</td> 21 <td tal:content="python:item[1]">Bob</td> 18 22 </tr> 19 23 </tbody> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py
r15998 r16235 379 379 if user_account: 380 380 local_roles = user_account.getLocalRoles() 381 if local_roles.has_key('waeup.local.TranscriptOfficer'): 381 site_roles = user_account.roles 382 if local_roles.has_key('waeup.local.TranscriptOfficer') \ 383 or 'waeup.TranscriptOfficer' in site_roles: 382 384 url = self.view.url(grok.getSite(), self.link) 383 385 text = translate(self.text, context=self.request)
Note: See TracChangeset for help on using the changeset viewer.