Ignore:
Timestamp:
23 May 2012, 07:44:04 (12 years ago)
Author:
Henrik Bettermann
Message:

items_changes must include state, password and transition (like in applicants).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py

    r8491 r8498  
    181181
    182182        # Update password
    183         passwd = row.get('password', IGNORE_MARKER)
    184         if passwd not in ('', IGNORE_MARKER):
    185             if passwd.startswith('{SSHA}'):
    186                 # already encrypted password
    187                 obj.password = passwd
    188             else:
    189                 # not yet encrypted password
    190                 IUserAccount(obj).setPassword(passwd)
     183        if row.has_key('password'):
     184            passwd = row.get('password', IGNORE_MARKER)
     185            if passwd not in ('', IGNORE_MARKER):
     186                if passwd.startswith('{SSHA}'):
     187                    # already encrypted password
     188                    obj.password = passwd
     189                else:
     190                    # not yet encrypted password
     191                    IUserAccount(obj).setPassword(passwd)
     192                items_changed += ('%s=%s, ' % ('password', passwd))
    191193            row.pop('password')
    192194
    193195        # Update registration state
    194         state = row.get('state', IGNORE_MARKER)
    195         if state not in (IGNORE_MARKER, ''):
    196             value = row['state']
    197             IWorkflowState(obj).setState(value)
    198             msg = _("State '${a}' set", mapping = {'a':value})
    199             history = IObjectHistory(obj)
    200             history.addMessage(msg)
     196        if row.has_key('state'):
     197            state = row.get('state', IGNORE_MARKER)
     198            if state not in (IGNORE_MARKER, ''):
     199                value = row['state']
     200                IWorkflowState(obj).setState(value)
     201                msg = _("State '${a}' set", mapping = {'a':value})
     202                history = IObjectHistory(obj)
     203                history.addMessage(msg)
     204                items_changed += ('%s=%s, ' % ('state', state))
    201205            row.pop('state')
    202         transition = row.get('transition', IGNORE_MARKER)
    203         if transition not in (IGNORE_MARKER, ''):
    204             value = row['transition']
    205             IWorkflowInfo(obj).fireTransition(value)
     206
     207        if row.has_key('transition'):
     208            transition = row.get('transition', IGNORE_MARKER)
     209            if transition not in (IGNORE_MARKER, ''):
     210                value = row['transition']
     211                IWorkflowInfo(obj).fireTransition(value)
     212                items_changed += ('%s=%s, ' % ('transition', transition))
    206213            row.pop('transition')
    207214
    208215        # apply other values...
    209         items_changed = super(StudentProcessor, self).updateEntry(
     216        items_changed += super(StudentProcessor, self).updateEntry(
    210217            obj, row, site)
    211218
Note: See TracChangeset for help on using the changeset viewer.