Ignore:
Timestamp:
21 Sep 2012, 08:19:35 (12 years ago)
Author:
uli
Message:

Rollback r9209. Looks like multiple merges from trunk confuse svn when merging back into trunk.

Location:
main/waeup.kofa/branches/uli-zc-async
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/branches/uli-zc-async

  • main/waeup.kofa/branches/uli-zc-async/src/waeup/kofa/students/student.py

    r9209 r9211  
    2828from zope.interface import implementedBy
    2929from zope.securitypolicy.interfaces import IPrincipalRoleManager
    30 from zope.schema.interfaces import ConstraintNotSatisfied
    3130
    3231from waeup.kofa.image import KofaImageFile
     
    131130
    132131    @property
    133     def current_level(self):
    134         level = getattr(
    135             self.get('studycourse', None), 'current_level', None)
    136         return level
    137 
    138     @property
    139     def current_verdict(self):
    140         level = getattr(
    141             self.get('studycourse', None), 'current_verdict', None)
    142         return level
    143 
    144     @property
    145132    def current_mode(self):
    146133        certificate = getattr(
     
    155142            self.get('studycourse', None), 'is_postgrad', False)
    156143        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 = certificate
    166             studycourse.entry_mode = 'transfer'
    167             studycourse.current_session = current_session
    168             studycourse.current_level = current_level
    169             studycourse.current_verdict = current_verdict
    170             studycourse.previous_verdict = previous_verdict
    171         except ConstraintNotSatisfied:
    172             return -1
    173         old = self['studycourse']
    174         if getattr(old, 'entry_session', None) is None or\
    175             getattr(old, 'certificate', None) is None:
    176             return -2
    177         studycourse.entry_session = old.entry_session
    178         # Students can be transferred only two times.
    179         if 'studycourse_1' in self.keys():
    180             if 'studycourse_2' in self.keys():
    181                 return -3
    182             self['studycourse_2'] = old
    183         else:
    184             self['studycourse_1'] = old
    185         del self['studycourse']
    186         self['studycourse'] = studycourse
    187         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         return
    194144
    195145
Note: See TracChangeset for help on using the changeset viewer.