Author: rjollos
Date: Tue Nov  5 07:39:31 2013
New Revision: 1538891

URL: http://svn.apache.org/r1538891
Log:
0.8dev: Don't try to add duplicate ticket relation when the `Ticket.duplicate` 
attribute is not present. Refs #710.

The `ITicketManipulator` interface isn't called when batch modifying tickets, 
so the `duplicate` attribute doesn't get added to the ticket object and ticket 
validation is not performed. The fix here is a temporary workaround to avoid a 
traceback, until batch modifications can add a duplicate ticket relation. Patch 
by Olemis Lang.

Modified:
    bloodhound/trunk/bloodhound_relations/bhrelations/api.py

Modified: bloodhound/trunk/bloodhound_relations/bhrelations/api.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_relations/bhrelations/api.py?rev=1538891&r1=1538890&r2=1538891&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_relations/bhrelations/api.py (original)
+++ bloodhound/trunk/bloodhound_relations/bhrelations/api.py Tue Nov  5 
07:39:31 2013
@@ -494,7 +494,8 @@ class TicketRelationsSpecifics(Component
     def ticket_changed(self, ticket, comment, author, old_values):
         if (
             self._closed_as_duplicate(ticket) and
-            self.rls.duplicate_relation_type
+            self.rls.duplicate_relation_type and
+            hasattr(ticket, 'duplicate') # workaround for comment:5:ticket:710
         ):
             try:
                 self.rls.add(ticket, ticket.duplicate,


Reply via email to