- Timestamp:
- 5 Jun 2015, 14:35:19 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py
r10480 r13036 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.component import createObject 25 27 from zope.interface import implementedBy 26 28 from waeup.kofa.utils.helpers import attrs_to_fields 29 from waeup.kofa.interfaces import CREATED 27 30 from waeup.kofa.students.studylevel import ( 28 31 StudentStudyLevel, CourseTicket, … … 58 61 def gpa_params_rectified(self): 59 62 return self.gpa_params 63 64 @property 65 def course_registration_allowed(self): 66 if self.student.is_fresh: 67 return True 68 try: 69 deadline = grok.getSite()['configuration'][ 70 str(self.level_session)].coursereg_deadline 71 except TypeError, KeyError: 72 return True 73 payment_made = False 74 if len(self.student['payments']): 75 for ticket in self.student['payments'].values(): 76 if ticket.p_category == 'late_registration' and \ 77 ticket.p_session == self.level_session and \ 78 ticket.p_state == 'paid': 79 payment_made = True 80 if deadline and deadline < datetime.now(pytz.utc) and not payment_made: 81 return False 82 return True 60 83 61 84 CustomStudentStudyLevel = attrs_to_fields(
Note: See TracChangeset for help on using the changeset viewer.