Changeset 16361 for main/waeup.uniben/trunk/src
- Timestamp:
- 10 Jan 2021, 22:30:18 (4 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r16171 r16361 56 56 NigeriaAccommodationDisplayFormPage, 57 57 NigeriaStudentBaseDisplayFormPage, 58 NigeriaStudentFilesUploadPage, 58 59 ) 59 60 … … 738 739 'email', 'phone') 739 740 form_fields['email'].field.required = True 741 742 class CustomStudentFilesUploadPage(NigeriaStudentFilesUploadPage): 743 """ View to upload passport picture. 744 745 Students are not allowed to change the picture if they 746 passed the regular Kofa application. 747 """ 748 749 def update(self): 750 # Passport pictures must not be editable if application slip 751 # exists. 752 slip = getUtility(IExtFileStore).getFileByContext( 753 self.context, 'application_slip') 754 PORTRAIT_CHANGE_STATES = getUtility(IStudentsUtils).PORTRAIT_CHANGE_STATES 755 if self.context.state not in PORTRAIT_CHANGE_STATES or slip is not None: 756 emit_lock_message(self) 757 return 758 super(StudentFilesUploadPage, self).update() 759 return -
main/waeup.uniben/trunk/src/waeup/uniben/students/viewlets.py
r16359 r16361 18 18 19 19 import grok 20 from waeup.kofa.interfaces import REQUESTED, REGISTERED 20 from zope.component import getUtility 21 from waeup.kofa.interfaces import REQUESTED, REGISTERED, IExtFileStore 21 22 from waeup.kofa.browser.viewlets import ManageActionButton 22 from waeup.uniben.students.interfaces import ( 23 ICustomStudentStudyCourse, ICustomStudentStudyLevel, 24 ICustomStudent, ) 23 from waeup.kofa.students.interfaces import IStudentsUtils 25 24 from waeup.kofa.students.fileviewlets import ( 26 25 StudentFileDisplay, StudentFileUpload, StudentImage,) … … 29 28 StudyLevelDisplayFormPage, StudentClearanceDisplayFormPage, 30 29 StudentBaseDisplayFormPage) 31 from waeup.kofa.students.viewlets import RequestTranscriptActionButton 30 from waeup.kofa.students.viewlets import ( 31 RequestTranscriptActionButton, StudentPassportActionButton) 32 33 from waeup.uniben.students.interfaces import ( 34 ICustomStudentStudyCourse, ICustomStudentStudyLevel, 35 ICustomStudent, ) 32 36 33 37 from kofacustom.nigeria.interfaces import MessageFactory as _ … … 38 42 def target_url(self): 39 43 return '' 44 45 class CustomStudentPassportActionButton(StudentPassportActionButton): 46 47 @property 48 def target_url(self): 49 # Passport pictures must not be editable if application slip 50 # exists. 51 slip = getUtility(IExtFileStore).getFileByContext( 52 self.context, 'application_slip') 53 PORTRAIT_CHANGE_STATES = getUtility(IStudentsUtils).PORTRAIT_CHANGE_STATES 54 if self.context.state not in PORTRAIT_CHANGE_STATES or slip is not None: 55 return '' 56 return self.view.url(self.view.context, self.target) 40 57 41 58 class SwitchLibraryAccessActionButton(ManageActionButton):
Note: See TracChangeset for help on using the changeset viewer.