Changeset 16782 for main


Ignore:
Timestamp:
6 Feb 2022, 22:01:22 (3 years ago)
Author:
Henrik Bettermann
Message:

Redirect after Plagiarism Test payment.

Location:
main/waeup.uniben/trunk/src/waeup/uniben
Files:
1 added
2 edited

Legend:

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

    r16606 r16782  
    4343    https = HTTPS
    4444    api_key = API_KEY
     45
     46    def render(self):
     47        if self.context.p_category == 'plag_test'\
     48            and self.context.p_state  == 'paid':
     49            self.redirect(self.url(self.context, 'plagtestinfo'))
     50        else:
     51            self.redirect(self.url(self.context, '@@index'))
     52        return
    4553
    4654class CustomRemitaVerifyPaymentStatusPageStudent(
  • main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py

    r16509 r16782  
    2727    REQUESTED, IExtFileStore, IKofaUtils, IObjectHistory)
    2828from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
    29 from waeup.kofa.browser.layout import action, KofaEditFormPage, UtilityView
     29from waeup.kofa.browser.layout import action, KofaEditFormPage, UtilityView, KofaPage
    3030from waeup.kofa.students.browser import (
    3131    StudentBaseEditFormPage,
     
    920920            self.context.student, studentview,
    921921            omit_fields=self.omit_fields,)
     922
     923class PlagTestInfoPage(KofaPage):
     924    "Landing page after plagiation test payment"
     925    grok.context(ICustomStudentOnlinePayment)
     926    grok.name('plagtestinfo')
     927    grok.require('waeup.handleStudent')
     928
     929    def update(self):
     930        if self.context.p_state != 'paid' \
     931            or self.contest.p_category != 'plag_test':
     932            self.flash(_('Forbidden'), type="danger")
     933            self.redirect(self.url(self.context))
     934        return super(PlagTestInfoPage, self).update()
Note: See TracChangeset for help on using the changeset viewer.