Changeset 2122


Ignore:
Timestamp:
18 Aug 2007, 20:05:03 (17 years ago)
Author:
Henrik Bettermann
Message:

log file size of picture if picture is too big

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/Widgets.py

    r2120 r2122  
    15261526            height = ''
    15271527            width = ''
    1528            
     1528
    15291529        else:
    15301530            image = open(file_path)
     
    16091609        """
    16101610        #import pdb; pdb.set_trace()
     1611        logger = logging.getLogger('Widgets.NoZodbImageWidget.validate')
    16111612        datamodel = datastructure.getDataModel()
    16121613        field_id = self.fields[0]
     
    16561657                max_size_str = self.getHumanReadableSize(self.size_max)
    16571658                err = 'This file is too big, the allowed max size is ${max_size}'
     1659                logger.info('%s tried to upload picture with size %dk' %(datastructure['reg_no'],int(size)/1000) )
    16581660                err_mapping = {'max_size': max_size_str}
    16591661                return self.validateError(err, err_mapping, datastructure)
Note: See TracChangeset for help on using the changeset viewer.