Ignore:
Timestamp:
30 Sep 2020, 06:53:05 (4 years ago)
Author:
Henrik Bettermann
Message:

Editing parents_email is only allowed in states 'admitted' and 'clearance started'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py

    r16258 r16259  
    2323from zope.formlib.textwidgets import BytesDisplayWidget
    2424from hurry.workflow.interfaces import IWorkflowInfo
    25 from waeup.kofa.interfaces import (REQUESTED, IExtFileStore, IKofaUtils,
    26     academic_sessions_vocab)
     25from waeup.kofa.interfaces import (REQUESTED, ADMITTED, CLEARANCE,
     26    IExtFileStore, IKofaUtils, academic_sessions_vocab)
    2727from waeup.kofa.widgets.datewidget import FriendlyDatetimeDisplayWidget
    2828from waeup.kofa.browser.layout import (
     
    7878    """ View to edit student base data
    7979    """
    80     form_fields = grok.AutoFields(ICustomStudentBase).select(
    81         'email', 'email2', 'parents_email', 'phone',)
     80    @property
     81    def form_fields(self):
     82        form_fields = grok.AutoFields(ICustomStudentBase).select(
     83            'email', 'email2', 'parents_email', 'phone',)
     84        if not self.context.state in (ADMITTED, CLEARANCE):
     85            form_fields['parents_email'].for_display = True
     86        return form_fields
    8287
    8388class CustomExportPDFCourseRegistrationSlip(
     
    119124    """ Page to edit personal data
    120125    """
    121     form_fields = grok.AutoFields(ICustomStudentPersonalEdit).omit('personal_updated')
     126    form_fields = grok.AutoFields(ICustomStudentPersonalEdit).omit(
     127        'personal_updated')
    122128
    123129    def update(self):
Note: See TracChangeset for help on using the changeset viewer.