Changeset 17811 for main/kofacustom.nigeria/trunk/src
- Timestamp:
- 6 Jun 2024, 11:11:23 (5 months ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/browser.py
r17141 r17811 248 248 'flash_notice') 249 249 250 class NigeriaStudentFilesUploadPage(StudentFilesUploadPage):251 """ View to upload passport picture.252 253 Students are not allowed to change the picture if they254 passed the regular Kofa application.255 """256 257 def update(self):258 # Passport pictures must not be editable if application slip259 # exists.260 slip = getUtility(IExtFileStore).getFileByContext(261 self.context, 'application_slip')262 PORTRAIT_CHANGE_STATES = getUtility(IStudentsUtils).PORTRAIT_CHANGE_STATES263 if self.context.state not in PORTRAIT_CHANGE_STATES or slip is not None:264 emit_lock_message(self)265 return266 return267 268 250 class ClearStudentFinancially(UtilityView, grok.View): 269 251 """ Clear student financially by financial clearance officer -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/utils.py
r15651 r17811 17 17 ## 18 18 import grok 19 from zope.component import getUtility 20 from waeup.kofa.interfaces import IExtFileStore 19 21 from waeup.kofa.students.utils import StudentsUtils 20 22 from kofacustom.nigeria.interfaces import MessageFactory as _ … … 41 43 # Maximum size of upload files in kB 42 44 MAX_KB = 250 45 46 def allowPortraitChange(self, student): 47 """Check if student is allowed to change the portrait file. 48 """ 49 # Passport pictures must not be editable if application slip 50 # exists. Students are not allowed to change the picture if they passed 51 # the regular Kofa application. 52 slip = getUtility(IExtFileStore).getFileByContext( 53 student, 'application_slip') 54 if student.state not in self.PORTRAIT_CHANGE_STATES or slip is not None: 55 return False 56 return True 57 -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/viewlets.py
r15846 r17811 41 41 return False 42 42 43 class StudentPassportActionButton(StudentPassportActionButton):44 45 @property46 def target_url(self):47 # Passport pictures must not be editable if application slip48 # exists.49 slip = getUtility(IExtFileStore).getFileByContext(50 self.context, 'application_slip')51 PORTRAIT_CHANGE_STATES = getUtility(IStudentsUtils).PORTRAIT_CHANGE_STATES52 if self.context.state not in PORTRAIT_CHANGE_STATES or slip is not None:53 return ''54 return self.view.url(self.view.context, self.target)55 56 43 class PaymentReceiptActionButton(PaymentReceiptActionButton): 57 44 grok.order(4)
Note: See TracChangeset for help on using the changeset viewer.