Changeset 8323
- Timestamp:
- 2 May 2012, 08:17:14 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8322 r8323 658 658 def addStudyLevel(self, **data): 659 659 level_code = self.request.form.get('addlevel', None) 660 studylevel = StudentStudyLevel()660 studylevel = createObject(u'waeup.StudentStudyLevel') 661 661 studylevel.level = int(level_code) 662 662 try: … … 1724 1724 def update(self, SUBMIT=None): 1725 1725 if not self.context.getStudent().state in (CLEARED,RETURNING): 1726 self.flash(_("Wrong state")) 1726 self.flash(_("You are in wrong state.")) 1727 self.redirect(self.url(self.context)) 1728 return 1729 if not self.context.may_register: 1730 self.flash(_("You are not entitled to start course registration.")) 1727 1731 self.redirect(self.url(self.context)) 1728 1732 return … … 1786 1790 @action(_('Create course list now'), style='primary') 1787 1791 def addStudyLevel(self, **data): 1788 studylevel = StudentStudyLevel()1792 studylevel = createObject(u'waeup.StudentStudyLevel') 1789 1793 studylevel.level = self.context.current_level 1790 1794 studylevel.level_session = self.context.current_session -
main/waeup.kofa/trunk/src/waeup/kofa/students/student.py
r8287 r8323 22 22 import grok 23 23 from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo 24 from zope.component import getUtility 24 from zope.component import getUtility, createObject 25 25 from zope.component.interfaces import IFactory 26 26 from zope.interface import implementedBy … … 161 161 else: 162 162 student.clearance_locked = True 163 studycourse = StudentStudyCourse()163 studycourse = createObject(u'waeup.StudentStudyCourse') 164 164 student['studycourse'] = studycourse 165 165 payments = StudentPaymentsContainer() -
main/waeup.kofa/trunk/src/waeup/kofa/students/studycourse.py
r8141 r8323 40 40 def getStudent(self): 41 41 return self.__parent__ 42 43 @property 44 def may_register(self): 45 return True 42 46 43 47 def addStudentStudyLevel(self, cert, studylevel): -
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r8262 r8323 444 444 @property 445 445 def target_url(self): 446 if not self.context.getStudent().state in (CLEARED,RETURNING): 446 if not self.context.getStudent().state in (CLEARED,RETURNING) \ 447 or not self.context.may_register: 447 448 return '' 448 449 return self.view.url(self.view.context, self.target)
Note: See TracChangeset for help on using the changeset viewer.