Changeset 16439
- Timestamp:
- 30 Mar 2021, 09:40:15 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r16427 r16439 23 23 from zope.formlib.textwidgets import BytesDisplayWidget 24 24 from zope.component import getUtility 25 from zope.event import notify 25 26 from hurry.workflow.interfaces import IWorkflowInfo 27 from waeup.kofa.utils.helpers import get_current_principal 26 28 from waeup.kofa.interfaces import ( 27 29 REQUESTED, IExtFileStore, IKofaUtils, IObjectHistory) … … 37 39 ExportPDFTranscriptSlip, 38 40 PaymentsManageFormPage, 39 StartClearancePage) 41 StartClearancePage, 42 StudyCourseManageFormPage) 40 43 from waeup.kofa.students.workflow import (CREATED, ADMITTED, PAID, 41 44 CLEARANCE, REQUESTED, RETURNING, CLEARED, REGISTERED, VALIDATED, … … 499 502 self.flash(_('Current level not available for certificate.')) 500 503 return 501 #notify(grok.ObjectModifiedEvent(self.context.__parent__))502 504 return 503 505 … … 516 518 def view_scores_allowed(self): 517 519 return checkPermission('waeup.manageStudent', self.context) 520 521 class CustomStudyCourseManageFormPage(StudyCourseManageFormPage): 522 """ Page to edit the student study course data 523 """ 524 525 @action(_('Save'), style='primary') 526 def save(self, **data): 527 user = get_current_principal() 528 if user.id not in ('admin', 'med', 'zope.mgr', 'zope.manager', 529 'benamechi', 'tbazuaye'): 530 if data['previous_verdict'] == 'R' and self.context.previous_verdict != 'R': 531 self.flash(_('You are not entitled to assign this verdict.'), 532 type="warning") 533 return 534 if data['current_verdict'] == 'R' and self.context.current_verdict != 'R': 535 self.flash(_('You are not entitled to assign this verdict.'), 536 type="warning") 537 return 538 try: 539 msave(self, **data) 540 except ConstraintNotSatisfied: 541 # The selected level might not exist in certificate 542 self.flash(_('Current level not available for certificate.'), 543 type="warning") 544 return 545 #notify(grok.ObjectModifiedEvent(self.context.__parent__)) 546 return 518 547 519 548 class CustomExportPDFCourseRegistrationSlip(
Note: See TracChangeset for help on using the changeset viewer.