1. Tetsuya Morimoto
  2. trac.plugins.ticketref

Commits

Tetsuya Morimoto  committed f29998e

fixed to show diff link even if no difference about ticket ids, related to 0f5a0796ca99

  • Participants
  • Parent commits a491bfb
  • Branches default

Comments (0)

Files changed (2)

File ticketref/utils.py

View file
  • Ignore whitespace
     ('added', set([3, 5]))
     >>> get_diff_refs(u"2, 3, 5", u"3")
     ('removed', set([2, 5]))
+    >>> get_diff_refs(u"2, 3, 5", u"2,3,5")
+    ('removed', set([]))
     """
     old = cnv_text2list(old_text)
     new = cnv_text2list(new_text)

File ticketref/web_ui.py

View file
  • Ignore whitespace
                 msg_key, diff_ids = get_diff_refs(old, new)
                 elements = [self._get_hyperlink_from_ticket(req, tkt_id)[0]
                             for tkt_id in diff_ids]
-                comma = tag.span(u', ')
-                tref["rendered"] = reduce(lambda x, y: x + comma + y, elements)
-                tref["rendered"] += tag.span(u' ' + _(msg_key))
+                if elements:
+                    comma, f = tag.span(u', '), lambda x, y: x + comma + y
+                    tref["rendered"] = reduce(f, elements)
+                    tref["rendered"] += tag.span(u' ' + _(msg_key))
                 tref["label"] = _("Relationships")
 
         return stream