- Timestamp:
- 21 Sep 2012, 08:19:35 (12 years ago)
- Location:
- main/waeup.kofa/branches/uli-zc-async
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/branches/uli-zc-async
- Property svn:mergeinfo changed
/main/waeup.kofa/branches/uli-async-update removed /main/waeup.kofa/branches/uli-autoinclude-less removed /main/waeup.kofa/trunk removed
- Property svn:mergeinfo changed
-
main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/students/student.py
r9209 r9211 28 28 from zope.interface import implementedBy 29 29 from zope.securitypolicy.interfaces import IPrincipalRoleManager 30 from zope.schema.interfaces import ConstraintNotSatisfied31 30 32 31 from waeup.kofa.image import KofaImageFile … … 131 130 132 131 @property 133 def current_level(self):134 level = getattr(135 self.get('studycourse', None), 'current_level', None)136 return level137 138 @property139 def current_verdict(self):140 level = getattr(141 self.get('studycourse', None), 'current_verdict', None)142 return level143 144 @property145 132 def current_mode(self): 146 133 certificate = getattr( … … 155 142 self.get('studycourse', None), 'is_postgrad', False) 156 143 return is_postgrad 157 158 def transfer(self, certificate, current_session=None,159 current_level=None, current_verdict=None, previous_verdict=None):160 """ Creates a new studycourse and backups the old one.161 162 """163 studycourse = createObject(u'waeup.StudentStudyCourse')164 try:165 studycourse.certificate = certificate166 studycourse.entry_mode = 'transfer'167 studycourse.current_session = current_session168 studycourse.current_level = current_level169 studycourse.current_verdict = current_verdict170 studycourse.previous_verdict = previous_verdict171 except ConstraintNotSatisfied:172 return -1173 old = self['studycourse']174 if getattr(old, 'entry_session', None) is None or\175 getattr(old, 'certificate', None) is None:176 return -2177 studycourse.entry_session = old.entry_session178 # Students can be transferred only two times.179 if 'studycourse_1' in self.keys():180 if 'studycourse_2' in self.keys():181 return -3182 self['studycourse_2'] = old183 else:184 self['studycourse_1'] = old185 del self['studycourse']186 self['studycourse'] = studycourse187 self.__parent__.logger.info(188 '%s - transferred from %s to %s' % (189 self.student_id, old.certificate.code, studycourse.certificate.code))190 history = IObjectHistory(self)191 history.addMessage('Transferred from %s to %s' % (192 old.certificate.code, studycourse.certificate.code))193 return194 144 195 145
Note: See TracChangeset for help on using the changeset viewer.