Changeset 14027 for main


Ignore:
Timestamp:
13 Jul 2016, 04:36:41 (8 years ago)
Author:
Henrik Bettermann
Message:

AAUE applicants are not allowed to remove payment tickets.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/browser.py

    r14017 r14027  
    2222from zope.component import getUtility, getAdapter
    2323from zope.i18n import translate
     24from hurry.workflow.interfaces import IWorkflowState
    2425from waeup.kofa.interfaces import (
    2526    IExtFileStore, IFileStoreNameChooser, IKofaUtils)
     
    2829from waeup.kofa.applicants.browser import (
    2930    ApplicantCheckStatusPage, ApplicantBaseDisplayFormPage)
     31from waeup.kofa.applicants.workflow import STARTED, PAID
    3032from waeup.kofa.applicants.viewlets import PDFActionButton
    3133from waeup.kofa.browser.layout import UtilityView
     
    300302    grok.template('applicanteditpage')
    301303
     304    def unremovable(self, ticket):
     305        return True
     306
     307    # AAUE applicants never see the 'Remove Selected Tickets' button.
     308    @property
     309    def display_actions(self):
     310        state = IWorkflowState(self.context).getState()
     311        # If the form is unlocked, applicants are allowed to save the form
     312        actions = [[_('Save')],]
     313        # Only in state started they can also add tickets.
     314        if state == STARTED:
     315            actions = [[_('Save')], [_('Add online payment ticket'),]]
     316        # In state paid, they can submit the data and further add tickets
     317        # if the application is special.
     318        elif self.context.special and state == PAID:
     319            actions = [[_('Save'), _('Finally Submit')],
     320                [_('Add online payment ticket'),]]
     321        elif state == PAID:
     322            actions = [[_('Save'), _('Finally Submit')],]
     323        return actions
     324
    302325    @property
    303326    def form_fields(self):
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/tests/test_browser.py

    r13999 r14027  
    5151        return
    5252
    53     def test_payment_slip_download_warning(self):
     53    def test_payment(self):
    5454        configuration = SessionConfiguration()
    5555        configuration.academic_session = session_1
     
    7070        self.assertEqual(self.browser.headers['Content-Type'],
    7171                 'application/pdf')
     72        # AAUE applicants never see the 'Remove Selected Tickets' button.
     73        self.browser.open(self.edit_path)
     74        self.assertFalse('Remove' in self.browser.contents)
    7275        return
    7376
Note: See TracChangeset for help on using the changeset viewer.