Changeset 14247
- Timestamp:
- 2 Nov 2016, 07:14:58 (8 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r14170 r14247 4 4 1.4.2.dev0 (unreleased) 5 5 ======================= 6 7 * Replace `course_registration_allowed` by `course_registration_forbidden` 8 method. 6 9 7 10 * Add export purge button. -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r14226 r14247 1592 1592 emit_lock_message(self) 1593 1593 return 1594 elif not self.context.course_registration_allowed: 1594 try: 1595 deadline = grok.getSite()['configuration'][ 1596 str(self.context.level_session)].coursereg_deadline 1597 except (TypeError, KeyError): 1598 deadline = None 1599 if deadline and deadline < datetime.now(pytz.utc): 1595 1600 self.flash(_( 1596 1601 "Course registration has ended. " … … 2724 2729 mapping = {'a':max_credits}), type="warning") 2725 2730 return 2726 if not self.context.course_registration_allowed: 2727 self.flash(_( 2728 "Course registration has ended. " 2729 "Please pay the late registration fee."), type="warning") 2730 #self.redirect(self.url(self.context)) 2731 msg = self.context.course_registration_forbidden 2732 if msg: 2733 self.flash(msg, type="warning") 2731 2734 return 2732 2735 IWorkflowInfo(self.context.student).fireTransition( -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r14159 r14247 555 555 gpa_params_rectified = Attribute('Corrected sessional GPA parameters') 556 556 gpa_params = Attribute('GPA parameters for this level.') 557 cumulative_params = Attribute('Cumulative GPA and other cumulative parameters for this level') 558 course_registration_allowed = Attribute('True if registerin courses is allowed') 557 cumulative_params = Attribute( 558 'Cumulative GPA and other cumulative parameters for this level') 559 course_registration_forbidden = Attribute( 560 'Return error message if course registration is forbidden') 559 561 560 562 level = schema.Choice( -
main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py
r14200 r14247 32 32 from waeup.kofa.utils.helpers import attrs_to_fields 33 33 from waeup.kofa.students.vocabularies import StudyLevelSource 34 from waeup.kofa.interfaces import MessageFactory as _ 34 35 35 36 def find_carry_over(ticket): … … 223 224 224 225 @property 225 def course_registration_ allowed(self):226 def course_registration_forbidden(self): 226 227 try: 227 228 deadline = grok.getSite()['configuration'][ 228 229 str(self.level_session)].coursereg_deadline 229 230 except (TypeError, KeyError): 230 return True231 return 231 232 if not deadline or deadline > datetime.now(pytz.utc): 232 return True 233 payment_made = False 233 return 234 234 if len(self.student['payments']): 235 235 for ticket in self.student['payments'].values(): … … 237 237 ticket.p_session == self.level_session and \ 238 238 ticket.p_state == 'paid': 239 payment_made = True 240 if payment_made: 241 return True 242 return False 239 return 240 return _("Course registration has ended. " 241 "Please pay the late registration fee.") 243 242 244 243 def addCourseTicket(self, ticket, course):
Note: See TracChangeset for help on using the changeset viewer.