Ignore:
Timestamp:
10 Jan 2016, 12:52:21 (9 years ago)
Author:
Henrik Bettermann
Message:

Let student managers be able to requery paid tickets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/browser.py

    r13479 r13578  
    1919from datetime import datetime, timedelta
    2020from zope.component import getUtility
     21from zope.security import checkPermission
    2122from waeup.kofa.interfaces import IKofaUtils
    2223from waeup.kofa.utils.helpers import to_timezone
     
    6364    @property
    6465    def target_url(self):
    65         if self.context.p_state in ('paid', 'waived'):
     66        if self.context.p_state == 'waived':
     67            return ''
     68        if self.context.p_state == 'paid' \
     69            and not checkPermission('waeup.manageStudent', self.context):
    6670            return ''
    6771        return self.view.url(self.view.context, self.target)
     
    8690
    8791    def update(self):
    88         if self.context.p_state in ('paid', 'waived'):
     92
     93        if self.context.p_state == 'waived':
     94            self.flash(_('This ticket cannot be requeried.'), type='warning')
     95            return
     96        if self.context.p_state == 'paid' \
     97            and not checkPermission('waeup.manageStudent', self.context):
    8998            self.flash(_('This ticket has already been paid.'), type='warning')
    9099            return
Note: See TracChangeset for help on using the changeset viewer.