Blob Blame History Raw
From 9e7b13a64dbc285ef68249dd7283b87c2df54000 Mon Sep 17 00:00:00 2001
From: Ralph Bean <rbean@redhat.com>
Date: Mon, 13 May 2013 20:12:19 -0400
Subject: [PATCH] Don't declare tickets open or closed unless the status has
 actually changed.

---
 fedmsg_meta_fedora_infrastructure/trac.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fedmsg_meta_fedora_infrastructure/trac.py b/fedmsg_meta_fedora_infrastructure/trac.py
index e410330..37aab32 100644
--- a/fedmsg_meta_fedora_infrastructure/trac.py
+++ b/fedmsg_meta_fedora_infrastructure/trac.py
@@ -81,11 +81,12 @@ class TracProcessor(BaseProcessor):
                     "{user} updated a ticket "
                     "on the {project} trac instance")
                 status = msg['msg']['ticket']['status']
-                if status == 'reopened':
+                old_values = msg['msg']['old_values']
+                if status == 'reopened' and 'status' in old_values:
                     tmpl = self._(
                         "{user} reopened a ticket "
                         "on the {project} trac instance")
-                elif status == 'closed':
+                elif status == 'closed' and 'status' in old_values:
                     resolution = msg['msg']['ticket']['resolution']
                     tmpl = self._(
                         "{user} closed a ticket "
-- 
1.8.1.4