Ignore:
Timestamp:
10 Sep 2011, 01:13:03 (13 years ago)
Author:
uli
Message:

Finetune log output a bit. Still too much code for little result. At
least we could use reduce() one more time :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/branches/uli-studentpw/src/waeup/sirp/students/browser.py

    r6709 r6710  
    598598        ob_class = self.__implemented__.__name__.replace('waeup.sirp.','')
    599599        changed_fields = self.applyData(self.context, **data)
    600         changed_fields = changed_fields.values()
    601         fields_string = '+'.join(' + '.join(
    602                 str(i) for i in b) for b in changed_fields)
    603         self.flash('Form has been saved.')
     600        # Turn list of lists into single list
     601        changed_fields = reduce(lambda x,y: x+y, changed_fields.values())
     602        changed_fields = [x for x in changed_fields
     603                          if not x.startswith('password')]
     604        if form.get('form.password', u'') != u'':
     605            self.context.loggerInfo(ob_class, 'password changed')
     606        fields_string = ' + '.join(changed_fields)
    604607        if fields_string:
     608            self.flash('Form has been saved.')
    605609            self.context.loggerInfo(ob_class, 'saved: % s' % fields_string)
    606610        return
Note: See TracChangeset for help on using the changeset viewer.