Changeset 13031
- Timestamp:
- 4 Jun 2015, 14:21:23 (9 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r13012 r13031 4 4 1.3.2.dev0 (unreleased) 5 5 ======================= 6 7 * Implement session-specific course registration deadline and 8 late registration payment. 6 9 7 10 * Remove quite old bug in `doImport`: Replace empty strings *and* lists with -
main/waeup.kofa/trunk/docs/source/userdocs/students/browser.rst
r13028 r13031 113 113 ===================== 114 114 115 Register Courses 116 ================ 117 115 118 Using Activation Codes 116 119 ====================== -
main/waeup.kofa/trunk/docs/source/userdocs/students/interfaces.rst
r13028 r13031 264 264 used for persistent storage of same-named attributes in the database. 265 265 266 The property attribute `course_registration_allowed` determines 267 whether course registration has ended. In the base package students 268 can proceed if they have paid late registration fee. The conditions 269 for course registration can be configured in custom packages. 270 266 271 `ICourseTicket` 267 272 --------------- -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r11869 r13031 252 252 title = _(u'Application Start Date'), 253 253 required = False, 254 description = _('Example: ') + u'2011-12-01 18:30:00+01:00',254 description = _('Example: ') + u'2011-12-01 18:30:00+01:00', 255 255 ) 256 256 … … 258 258 title = _(u'Application Closing Date'), 259 259 required = False, 260 description = _('Example: ') + u'2011-12-31 23:59:59+01:00',260 description = _('Example: ') + u'2011-12-31 23:59:59+01:00', 261 261 ) 262 262 -
main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py
r13029 r13031 696 696 ) 697 697 698 current_coursereg_deadline = schema.Datetime(699 title = _(u'Current Course Registration Deadline'),700 required = False,701 description = _('Example: ') + u'2011-12-31 23:59:59+01:00',702 )703 704 698 current_academic_session = schema.Choice( 705 699 title = _(u'Current Academic Session'), … … 762 756 ) 763 757 758 late_registration_fee = schema.Float( 759 title = _(u'Late Course Registration Fee'), 760 default = 0.0, 761 required = False, 762 ) 763 764 764 clearance_enabled = schema.Bool( 765 765 title = _(u'Clearance enabled'), … … 774 774 required = False, 775 775 default = [], 776 ) 777 778 coursereg_deadline = schema.Datetime( 779 title = _(u'Current Course Registration Deadline'), 780 required = False, 781 description = _('Example: ') + u'2011-12-31 23:59:59+01:00', 776 782 ) 777 783 -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r13028 r13031 2682 2682 mapping = {'a':max_credits}), type="warning") 2683 2683 return 2684 if not self.context.course_registration_allowed: 2685 self.flash(_( 2686 "Course registration has ended. " 2687 "Please pay the late registration fee."), type="warning") 2688 #self.redirect(self.url(self.context)) 2689 return 2684 2690 IWorkflowInfo(self.context.student).fireTransition( 2685 2691 'register_courses') -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r13012 r13031 578 578 gpa_params = Attribute('GPA parameters for this level.') 579 579 cumulative_params = Attribute('Cumulative GPA and other cumulative parameters for this level') 580 course_registration_allowed = Attribute('True if registerin courses is allowed') 580 581 581 582 level = schema.Choice( -
main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py
r13008 r13031 21 21 """ 22 22 import grok 23 import pytz 24 from datetime import datetime 23 25 from zope.component.interfaces import IFactory 24 26 from zope.catalog.interfaces import ICatalog … … 205 207 return studylevelsource.factory.getTitle(self.__parent__, self.level) 206 208 209 @property 210 def course_registration_allowed(self): 211 try: 212 deadline = grok.getSite()['configuration'][ 213 str(self.level_session)].coursereg_deadline 214 except TypeError, KeyError: 215 return True 216 payment_made = False 217 if len(self.student['payments']): 218 for ticket in self.student['payments'].values(): 219 if ticket.p_category == 'late_registration' and \ 220 ticket.p_session == self.level_session and \ 221 ticket.p_state == 'paid': 222 payment_made = True 223 if deadline and deadline < datetime.now(pytz.utc) and not payment_made: 224 return False 225 return True 226 207 227 def addCourseTicket(self, ticket, course): 208 228 """Add a course ticket object. … … 294 314 def editable_by_lecturer(self): 295 315 try: 296 cas = grok.getSite()['configuration'].current_academic_session 297 if self.student.state == VALIDATED and self.student.current_session == cas: 316 cas = grok.getSite()[ 317 'configuration'].current_academic_session 318 if self.student.state == VALIDATED and \ 319 self.student.current_session == cas: 298 320 return True 299 321 except (AttributeError, TypeError): # in unit tests … … 302 324 303 325 def writeLogMessage(self, view, message): 304 return self.__parent__.__parent__.__parent__.writeLogMessage(view, message) 326 return self.__parent__.__parent__.__parent__.writeLogMessage( 327 view, message) 305 328 306 329 @property -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r13012 r13031 194 194 configuration.booking_fee = 123.4 195 195 configuration.maint_fee = 987.0 196 configuration.late_registration_fee = 345.0 196 197 self.app['configuration'].addSessionConfiguration(configuration) 197 198 … … 3179 3180 in logcontent) 3180 3181 3182 def test_late_registration(self): 3183 # Login 3184 delta = timedelta(days=10) 3185 self.app['configuration'][ 3186 '2004'].coursereg_deadline = datetime.now(pytz.utc) - delta 3187 IWorkflowState(self.student).setState('school fee paid') 3188 self.browser.open(self.login_path) 3189 self.browser.getControl(name="form.login").value = self.student_id 3190 self.browser.getControl(name="form.password").value = 'spwd' 3191 self.browser.getControl("Login").click() 3192 self.browser.open(self.payments_path) 3193 self.browser.open(self.payments_path + '/addop') 3194 self.browser.getControl(name="form.p_category").value = ['late_registration'] 3195 self.browser.getControl("Create ticket").click() 3196 self.assertMatches('...ticket created...', 3197 self.browser.contents) 3198 self.browser.open(self.payments_path) 3199 ctrl = self.browser.getControl(name='val_id') 3200 value = ctrl.options[0] 3201 self.browser.getLink("Study Course").click() 3202 self.browser.getLink("Add course list").click() 3203 self.assertMatches('...Add current level 100 (Year 1)...', 3204 self.browser.contents) 3205 self.browser.getControl("Create course list now").click() 3206 self.browser.getLink("100").click() 3207 self.browser.getLink("Edit course list").click() 3208 self.browser.getControl("Register course list").click() 3209 self.assertTrue('Course registration has ended. Please pay' in self.browser.contents) 3210 self.student['payments'][value].approve() 3211 self.browser.getControl("Register course list").click() 3212 self.assertTrue('Course list has been registered' in self.browser.contents) 3213 self.assertEqual(self.student.state, 'courses registered') 3214 3215 3181 3216 class StudentRequestPWTests(StudentsFullSetup): 3182 3217 # Tests for student registration -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r12971 r13031 471 471 elif category == 'transcript': 472 472 amount = academic_session.transcript_fee 473 elif category == 'late_registration': 474 amount = academic_session.late_registration_fee 473 475 if amount in (0.0, None): 474 476 return _('Amount could not be determined.'), None -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r12588 r13031 175 175 'application': 'Application Fee', 176 176 'transcript': 'Transcript Fee', 177 'late_registration': 'Late Course Registration Fee' 177 178 } 178 179
Note: See TracChangeset for help on using the changeset viewer.