Changeset 10022 for main/kofacustom.nigeria
- Timestamp:
- 13 Mar 2013, 06:25:17 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/viewlets.py
r9381 r10022 18 18 19 19 import grok 20 from zope.component import getUtility 21 from waeup.kofa.students.interfaces import IStudentsUtils 20 22 from waeup.kofa.students.viewlets import ( 21 23 FileDisplay, FileUpload, Image) … … 23 25 24 26 from kofacustom.nigeria.interfaces import MessageFactory as _ 27 28 def show_viewlet(viewlet): 29 students_utils = getUtility(IStudentsUtils) 30 if viewlet.__name__ in students_utils.SKIP_UPLOAD_VIEWLETS: 31 return False 32 cm = getattr(viewlet.context,'current_mode', None) 33 if cm is not None and cm.startswith('pg'): 34 return True 35 return False 25 36 26 37 # Acceptance Letter … … 189 200 @property 190 201 def show_viewlet(self): 191 cm = getattr(self.context,'current_mode', None) 192 if cm is not None and cm.startswith('pg'): 193 return True 194 return False 202 return show_viewlet(self) 195 203 196 204 class SecondHigherQualificationResultImage(Image): … … 280 288 @property 281 289 def show_viewlet(self): 282 cm = getattr(self.context,'current_mode', None) 283 if cm is not None and cm.startswith('pg'): 284 return True 285 return False 290 return show_viewlet(self) 286 291 287 292 class SecondCertificateImage(Image): … … 315 320 @property 316 321 def show_viewlet(self): 317 cm = getattr(self.context,'current_mode', None) 318 if cm is not None and cm.startswith('pg'): 319 return True 320 return False 322 return show_viewlet(self) 321 323 322 324 class ThirdCertificateImage(Image): … … 434 436 @property 435 437 def show_viewlet(self): 436 cm = getattr(self.context,'current_mode', None) 437 if cm is not None and cm.startswith('pg'): 438 return True 439 return False 438 return show_viewlet(self) 440 439 441 440 class SecondRefereeLetterImage(Image): … … 469 468 @property 470 469 def show_viewlet(self): 471 cm = getattr(self.context,'current_mode', None) 472 if cm is not None and cm.startswith('pg'): 473 return True 474 return False 470 return show_viewlet(self) 475 471 476 472 class ThirdRefereeLetterImage(Image): … … 532 528 @property 533 529 def show_viewlet(self): 534 cm = getattr(self.context,'current_mode', None) 535 if cm is not None and cm.startswith('pg'): 536 return True 537 return False 530 return show_viewlet(self) 538 531 539 532 class LetterAdmissionImage(Image):
Note: See TracChangeset for help on using the changeset viewer.