Edgewall Software

Changes between Initial Version and Version 1 of Ticket #2259, comment 63


Ignore:
Timestamp:
Nov 30, 2014, 12:40:17 PM (5 years ago)
Author:
Ryan J Ollos

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2259, comment 63

    initial v1  
    11I was thinking about whether we really need the option `[notification] ticket_notify_attachment`. The `TicketAttachmentNotifier` can already be disabled by disabling the component: `trac.ticket.notification.ticketattachmentnotifier = disabled`. It is always nice to have one fewer option and we could just document how to disable the component on the TracNotification page. Do that seem straightforward enough, or does anyone see a reason to keep the `[notification]` option?
     2
     3{{{#!diff
     4diff --git a/trac/ticket/notification.py b/trac/ticket/notification.py
     5index cace8ee..d34e3ee 100644
     6--- a/trac/ticket/notification.py
     7+++ b/trac/ticket/notification.py
     8@@ -502,19 +502,13 @@ class TicketAttachmentNotifier(Component):
     9 
     10     implements(IAttachmentChangeListener)
     11 
     12-    ticket_notify_attachment = BoolOption('notification',
     13-                                          'ticket_notify_attachment', True,
     14-        """Always send notifications on ticket attachment events.""")
     15-
     16     # IAttachmentChangeListener methods
     17 
     18     def attachment_added(self, attachment):
     19-        if self.ticket_notify_attachment:
     20-            self._notify_attachment(attachment, True)
     21+        self._notify_attachment(attachment, True)
     22 
     23     def attachment_deleted(self, attachment):
     24-        if self.ticket_notify_attachment:
     25-            self._notify_attachment(attachment, False)
     26+        self._notify_attachment(attachment, False)
     27 
     28     def attachment_reparented(self, attachment, old_parent_realm,
     29                               old_parent_id):
     30}}}