Changeset 16440


Ignore:
Timestamp:
31 Mar 2021, 20:52:44 (3 years ago)
Author:
Henrik Bettermann
Message:

Revert changes of r16439. We can't customize single actions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py

    r16439 r16440  
    2323from zope.formlib.textwidgets import BytesDisplayWidget
    2424from zope.component import getUtility
    25 from zope.event import notify
    2625from hurry.workflow.interfaces import IWorkflowInfo
    27 from waeup.kofa.utils.helpers import get_current_principal
    2826from waeup.kofa.interfaces import (
    2927    REQUESTED, IExtFileStore, IKofaUtils, IObjectHistory)
     
    3937    ExportPDFTranscriptSlip,
    4038    PaymentsManageFormPage,
    41     StartClearancePage,
    42     StudyCourseManageFormPage)
     39    StartClearancePage)
    4340from waeup.kofa.students.workflow import (CREATED, ADMITTED, PAID,
    4441    CLEARANCE, REQUESTED, RETURNING, CLEARED, REGISTERED, VALIDATED,
     
    502499            self.flash(_('Current level not available for certificate.'))
    503500            return
     501        #notify(grok.ObjectModifiedEvent(self.context.__parent__))
    504502        return
    505503
     
    518516    def view_scores_allowed(self):
    519517        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
    547518
    548519class CustomExportPDFCourseRegistrationSlip(
Note: See TracChangeset for help on using the changeset viewer.