Changeset 16258 for main


Ignore:
Timestamp:
29 Sep 2020, 20:20:08 (4 years ago)
Author:
Henrik Bettermann
Message:

Only fresh students are allowed to edit personal (bio) data. No idea why!

Location:
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada
Files:
3 edited

Legend:

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

    r16255 r16258  
    121121    form_fields = grok.AutoFields(ICustomStudentPersonalEdit).omit('personal_updated')
    122122
     123    def update(self):
     124        if not self.context.is_fresh:
     125            self.flash('Not allowed.', type="danger")
     126            self.redirect(self.url(self.context))
     127            return
     128        super(CustomStudentPersonalEditFormPage, self).update()
     129        return
     130
     131
    123132class CustomStudentPersonalManageFormPage(NigeriaStudentPersonalManageFormPage):
    124133    """ Page to edit personal data
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/viewlets.py

    r16256 r16258  
    3939    text = _('Edit registration bio data')
    4040
     41    @property
     42    def target_url(self):
     43        if not self.context.is_fresh:
     44            return ''
     45        return self.view.url(self.view.context, self.target)
     46
    4147class SwitchLibraryAccessActionButton(ManageActionButton):
    4248    grok.order(7)
     
    6571    target = 'edit_personal'
    6672
     73    @property
     74    def target_url(self):
     75        if not self.context.is_fresh:
     76            return ''
     77        return self.view.url(self.view.context, self.target)
     78
    6779class PersonalDataSlipActionButton(ManageActionButton):
    6880    grok.order(10)
     
    7385    target = 'personal_slip.pdf'
    7486    icon = 'actionicon_pdf.png'
     87
     88    @property
     89    def target_url(self):
     90        if not self.context.is_fresh:
     91            return ''
     92        return self.view.url(self.view.context, self.target)
    7593
    7694class AddBalancePaymentActionButton(AddBalancePaymentActionButton):
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/utils/utils.py

    r16233 r16258  
    151151        'fine': 'Fine',
    152152        'id_card': 'Student ID Card',
     153        'required_combi': 'Required Combi Payment',
    153154        'pg_other': 'PG Other Charges',
    154155        }
Note: See TracChangeset for help on using the changeset viewer.