Changeset 2362


Ignore:
Timestamp:
03/27/08 14:35:18 (12 years ago)
Author:
jukka
Message:

Fixed #1719

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Resources.py

    r2346 r2362  
    564564        """ download a file """ 
    565565        from Products.Archetypes.utils import contentDispositionHeader 
     566        if not hasattr(field, 'getFilename'): # something is wrong here 
     567            return None 
    566568        org_filename = field.getFilename(self) 
    567569        filename = self.Title() 
     
    579581                extension = mt[0].extensions[0]       # and take first one from here too 
    580582                extension = '.'+extension 
    581         if extension: 
     583        if extension and not filename.endswith(extension): 
    582584            filename += extension 
    583585        header_value = contentDispositionHeader('attachment', self.getCharset(), filename=filename) 
Note: See TracChangeset for help on using the changeset viewer.