=== modified file 'lib/lp/bugs/browser/bugmessage.py' --- a/lib/lp/bugs/browser/bugmessage.py 2010-03-23 03:54:54 +0000 +++ b/lib/lp/bugs/browser/bugmessage.py 2010-06-03 00:28:00 +0000 @@ -127,8 +127,9 @@ self.next_url = self.nextUrlForInconsistentPatchFlags( attachment) - self.request.response.addNotification( - "Attachment %s added to bug." % filename) + if not data['comment']: + self.request.response.addNotification( + "Attachment %s added to bug." % filename) def shouldShowEmailMeWidget(self): === modified file 'lib/lp/bugs/browser/bugtarget.py' --- a/lib/lp/bugs/browser/bugtarget.py 2010-05-18 22:36:20 +0000 +++ b/lib/lp/bugs/browser/bugtarget.py 2010-06-03 00:28:00 +0000 @@ -467,6 +467,7 @@ attachment_comment = bug.newMessage( owner=self.user, subject=bug.followup_subject(), content=None) + notify_attachments = [] # Deal with attachments added in the filebug form. if attachment: # We convert slashes in filenames to hyphens to avoid @@ -486,18 +487,24 @@ filename=filename, description=file_description, comment=attachment_comment, is_patch=data['patch']) - notifications.append( - 'The file "%s" was attached to the bug report.' % - cgi.escape(filename)) + notify_attachments.append(cgi.escape(filename)) for attachment in extra_data.attachments: bug.linkAttachment( owner=self.user, file_alias=attachment['file_alias'], description=attachment['description'], comment=attachment_comment) - notifications.append( - 'The file "%s" was attached to the bug report.' % - cgi.escape(attachment['file_alias'].filename)) + notify_attachments.append(cgi.escape(attachment['file_alias'].filename)) + + if len(notifications) == 0: + if len(notify_attachments) == 1: + notifications.append( + 'The file "%s" was attached to the bug report.' % + notify_attachments[0]) + else: + notifications.append( + '%d files were attached to the bug report.' % + len(notify_attachments[0])) if extra_data.subscribers: # Subscribe additional subscribers to this bug