Changeset 8472 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 20 May 2012, 09:57:09 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8471 r8472 412 412 @property 413 413 def form_fields(self): 414 cm = getattr(self.context,'current_mode', None) 415 if cm is not None and cm.startswith('pg'): 414 if self.context.is_postgrad: 416 415 form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked') 417 416 else: … … 434 433 @property 435 434 def form_fields(self): 436 cm = getattr(self.context,'current_mode', None) 437 if cm is not None and cm.startswith('pg'): 435 if self.context.is_postgrad: 438 436 form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked') 439 437 else: … … 478 476 @property 479 477 def form_fields(self): 480 cm = getattr(self.context,'current_mode', None) 481 if cm is not None and cm.startswith('pg'): 478 if self.context.is_postgrad: 482 479 form_fields = grok.AutoFields(IPGStudentClearance) 483 480 else: … … 1621 1618 @property 1622 1619 def form_fields(self): 1623 cm = getattr(self.context,'current_mode', None) 1624 if cm is not None and cm.startswith('pg'): 1620 if self.context.is_postgrad: 1625 1621 form_fields = grok.AutoFields(IPGStudentClearance).omit('clearance_locked') 1626 1622 else: -
main/waeup.kofa/trunk/src/waeup/kofa/students/student.py
r8452 r8472 133 133 if certificate is not None: 134 134 return certificate.study_mode 135 return 135 return None 136 137 @property 138 def is_postgrad(self): 139 is_postgrad = getattr( 140 self.get('studycourse', None), 'is_postgrad', False) 141 return is_postgrad 136 142 137 143 # Set all attributes of Student required in IStudent as field -
main/waeup.kofa/trunk/src/waeup/kofa/students/studycourse.py
r8471 r8472 48 48 return True 49 49 if self.getStudent().state == PAID \ 50 and self.getStudent(). current_mode.startswith('pg'):50 and self.getStudent().is_postgrad: 51 51 return True 52 52 return False … … 105 105 return 106 106 107 @property 108 def is_postgrad(self): 109 cert = getattr(self, 'certificate', None) 110 if cert is not None: 111 return cert.study_mode.startswith('pg') 112 #return cert.start_level == 999 or cert.end_level == 999 113 return False 114 107 115 StudentStudyCourse = attrs_to_fields(StudentStudyCourse) 108 116 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r8471 r8472 1837 1837 self.assertFalse('Employer' in self.browser.contents) 1838 1838 # Now we change the study mode of the certificate and a different 1839 # interface is used by clearance views 1839 # interface is used by clearance views. 1840 1840 self.certificate.study_mode = 'pg_ft' 1841 # Invariants are not being checked here?! 1842 self.certificate.end_level = 100 1841 1843 self.browser.open(self.clearance_path) 1842 1844 self.assertTrue('Employer' in self.browser.contents) -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r8471 r8472 278 278 details['p_session'], details[ 279 279 'p_level'] = self.getReturningData(student) 280 elif student. current_mode.startswith('pg')and student.state == PAID:280 elif student.is_postgrad and student.state == PAID: 281 281 # Returning postgraduate students also pay for the next session 282 282 # but their level always remains the same.
Note: See TracChangeset for help on using the changeset viewer.