Changeset 17807


Ignore:
Timestamp:
3 Jun 2024, 13:23:31 (5 months ago)
Author:
Henrik Bettermann
Message:

tighten up some of those allowances

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
3 edited

Legend:

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

    r17750 r17807  
    874874    form_fields['email'].field.required = True
    875875
    876 class CustomStudentFilesUploadPage(NigeriaStudentFilesUploadPage):
    877     """ View to upload passport picture.
    878     """
    879 
    880     def update(self):
    881         # Postgrad students should allowed to change their picture whenever they want.
    882         if self.context.is_postgrad:
    883             return
    884         if self.context.is_jupeb:
    885             emit_lock_message(self)
    886             return           
    887         super(StudentFilesUploadPage, self).update()
    888         return
    889 
    890876
    891877
  • main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py

    r17743 r17807  
    817817    #: A tuple containing the names of registration states in which changing of
    818818    #: passport pictures is allowed.
    819     PORTRAIT_CHANGE_STATES = (CLEARANCE, REQUESTED)
     819    PORTRAIT_CHANGE_STATES = (CLEARANCE, ADMITTED)
     820
     821    def allowPortraitChange(self, student):
     822        """Check if student is allowed to change the portrait file.
     823        """
     824        if student.is_jupeb:
     825            return False
     826        if student.state not in self.PORTRAIT_CHANGE_STATES:
     827            return False
     828        return True
    820829
    821830    #: A tuple containing the names of registration states in which changing of
  • main/waeup.uniben/trunk/src/waeup/uniben/students/viewlets.py

    r17542 r17807  
    5353    grok.require('waeup.viewStudent')
    5454
    55 class StudentPassportActionButton(StudentPassportActionButton):
    56 
    57     @property
    58     def target_url(self):
    59         if self.context.is_jupeb:
    60             return ''
    61         PORTRAIT_CHANGE_STATES = getUtility(IStudentsUtils).PORTRAIT_CHANGE_STATES
    62         if self.context.state not in PORTRAIT_CHANGE_STATES and not self.context.is_postgrad:
    63             return ''
    64         return self.view.url(self.view.context, self.target)
    6555
    6656class SwitchLibraryAccessActionButton(ManageActionButton):
Note: See TracChangeset for help on using the changeset viewer.