Changeset 11772 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 31 Jul 2014, 04:38:23 (10 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r11732 r11772 135 135 yield value_dict 136 136 137 def clearance_disabled_message(student):138 try:139 session_config = grok.getSite()[140 'configuration'][str(student.current_session)]141 except KeyError:142 return _('Session configuration object is not available.')143 if not session_config.clearance_enabled:144 return _('Clearance is disabled for this session.')145 return None146 147 137 def addCourseTicket(view, course=None): 148 138 students_utils = getUtility(IStudentsUtils) … … 768 758 769 759 def update(self): 770 if clearance_disabled_message(self.context): 771 self.flash(clearance_disabled_message(self.context)) 760 cdm = getUtility(IStudentsUtils).clearance_disabled_message(self.context) 761 if cdm: 762 self.flash(cdm) 772 763 self.redirect(self.url(self.context,'view_clearance')) 773 764 return … … 794 785 795 786 def update(self): 796 if clearance_disabled_message(self.context): 797 self.flash(clearance_disabled_message(self.context), type="warning") 787 cdm = getUtility(IStudentsUtils).clearance_disabled_message(self.context) 788 if cdm: 789 self.flash(cdm, type="warning") 798 790 self.redirect(self.url(self.context,'view_clearance')) 799 791 return -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r11641 r11772 910 910 return bedticket.bed_coordinates 911 911 912 def clearance_disabled_message(self, student): 913 try: 914 session_config = grok.getSite()[ 915 'configuration'][str(student.current_session)] 916 except KeyError: 917 return _('Session configuration object is not available.') 918 if not session_config.clearance_enabled: 919 return _('Clearance is disabled for this session.') 920 return None 921 912 922 VERDICTS_DICT = { 913 923 '0': _('(not yet)'), -
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r11612 r11772 35 35 VALIDATED, GRADUATED, TRANSCRIPT) 36 36 from waeup.kofa.students.browser import ( 37 clearance_disabled_message,38 37 StudentClearanceManageFormPage, 39 38 StudentBaseManageFormPage, StudentFilesUploadPage, … … 272 271 @property 273 272 def target_url(self): 274 if clearance_disabled_message(self.context): 273 cdm = getUtility(IStudentsUtils).clearance_disabled_message(self.context) 274 if cdm: 275 275 return '' 276 276 if self.context.state != REQUESTED: … … 289 289 @property 290 290 def target_url(self): 291 if clearance_disabled_message(self.context): 291 cdm = getUtility(IStudentsUtils).clearance_disabled_message(self.context) 292 if cdm: 292 293 return '' 293 294 if self.context.state not in (REQUESTED, CLEARED):
Note: See TracChangeset for help on using the changeset viewer.