Changeset 319 for trunk/email2trac.py.in


Ignore:
Timestamp:
02/22/10 15:13:34 (14 years ago)
Author:
bas
Message:

When there a problems with saving attachments. Show it as comment in the ticket, closes #165

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r318 r319  
    927927                ## Save the attachments to the ticket   
    928928                #
    929                 has_attachments =  self.attachments(message_parts)
    930 
    931                 #  Disabled
    932                 #if has_attachments:
    933                 #       changed = True
    934                 #       comment = '%s\n%s\n' %(comment, has_attachments)
     929                error_with_attachments =  self.attachments(message_parts)
     930
     931                if error_with_attachments:
     932                        changed = True
     933                        comment = '%s\n%s\n' %(comment, error_with_attachments)
    935934
    936935                if changed:
     
    15081507                #
    15091508                max_size = int(self.get_config('attachment', 'max_size'))
    1510                 status   = ''
     1509                status   = None
    15111510               
    15121511                for part in message_parts:
     
    15641563                        os.unlink(path)
    15651564
    1566                 # Return how many attachments
    1567                 #
    1568                 status = 'This message has %d attachment(s)\n%s' %(count, status)
     1565                ## return error
     1566                #
    15691567                return status
    15701568
Note: See TracChangeset for help on using the changeset viewer.