Changeset 7659


Ignore:
Timestamp:
16 Feb 2012, 15:30:12 (13 years ago)
Author:
Henrik Bettermann
Message:

Tell the log file which attributes have been changed when editing user accounts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py

    r7655 r7659  
    454454                self.flash( ' '.join(errors))
    455455                return
    456         self.applyData(self.context, **data)
     456        changed_fields = self.applyData(self.context, **data)
     457        if changed_fields:
     458            changed_fields = reduce(lambda x,y: x+y, changed_fields.values())
     459        else:
     460            changed_fields = []
    457461        if password:
    458462            # Now we know that the form has no errors and can set password ...
    459463            self.context.setPassword(password)
     464            changed_fields.append('password')
     465        fields_string = ' + '.join(changed_fields)
     466        if fields_string:
     467            self.context.__parent__.logger.info(
     468                'User account %s edited: %s' % (self.context.name,fields_string))
    460469        self.flash('User settings have been saved.')
    461470        return
Note: See TracChangeset for help on using the changeset viewer.