Ignore:
Timestamp:
3 Apr 2021, 15:35:01 (4 years ago)
Author:
Henrik Bettermann
Message:

Allow customization of lock message.

File:
1 edited

Legend:

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

    r16431 r16444  
    110110    return
    111111
    112 def emit_lock_message(view):
     112def emit_lock_message(view, msg=None):
    113113    """Flash a lock message.
    114114    """
     115    if msg:
     116        view.flash(msg, type="warning")
     117        view.redirect(view.url(view.context))
     118        return
    115119    view.flash(_('The requested form is locked (read-only).'), type="warning")
    116120    view.redirect(view.url(view.context))
     
    29322936        PORTRAIT_CHANGE_STATES = getUtility(IStudentsUtils).PORTRAIT_CHANGE_STATES
    29332937        if self.context.student.state not in PORTRAIT_CHANGE_STATES:
    2934             emit_lock_message(self)
     2938            emit_lock_message(self,
     2939                _('This form is locked. You are in the wrong state.'))
    29352940            return
    29362941        super(StudentFilesUploadPage, self).update()
Note: See TracChangeset for help on using the changeset viewer.