- Timestamp:
- 25 Oct 2016, 06:19:20 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/studylevel.py
r14206 r14227 28 28 from waeup.kofa.utils.helpers import attrs_to_fields 29 29 from waeup.kofa.interfaces import CREATED 30 from waeup.kofa.students.browser import TicketError 30 31 from waeup.kofa.students.studylevel import ( 31 32 StudentStudyLevel, CourseTicket, … … 160 161 return 'N/A' 161 162 163 def _schoolfeePaymentMade(self): 164 if len(self.student['payments']): 165 for ticket in self.student['payments'].values(): 166 if ticket.p_state == 'paid' and \ 167 ticket.p_category in ( 168 'schoolfee', 'schoolfee_incl', 'schoolfee_2',) and \ 169 ticket.p_session == self.student[ 170 'studycourse'].current_session: 171 return True 172 return False 173 162 174 def addCourseTicket(self, ticket, course): 163 175 """Add a course ticket object. … … 166 178 raise TypeError( 167 179 'StudentStudyLeves contain only ICourseTicket instances') 180 # Raise TicketError if course is in 2nd semester but 181 # schoolfee has not yet been fully paid. 182 if course.semester == 2 and not self._schoolfeePaymentMade(): 183 raise TicketError 168 184 ticket.code = course.code 169 185 ticket.title = course.title … … 179 195 return 180 196 197 def addCertCourseTickets(self, cert): 198 """Collect all certificate courses and create course 199 tickets automatically. 200 """ 201 if cert is not None: 202 for key, val in cert.items(): 203 if val.level != self.level: 204 continue 205 ticket = createObject(u'waeup.CourseTicket') 206 ticket.automatic = True 207 ticket.mandatory = val.mandatory 208 ticket.carry_over = False 209 try: 210 self.addCourseTicket(ticket, val.course) 211 except TicketError: 212 pass 213 return 214 181 215 CustomStudentStudyLevel = attrs_to_fields( 182 216 CustomStudentStudyLevel, omit=[
Note: See TracChangeset for help on using the changeset viewer.