Modify ↓
Opened 15 years ago
Closed 15 years ago
#6859 closed defect (duplicate)
[patch] Fixing broken ticket diff viewing
Reported by: | anonymous | Owned by: | Noah Kantrowitz |
---|---|---|---|
Priority: | normal | Component: | MasterTicketsPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
-
0.11/mastertickets/web_ui.py
old new 59 59 # Add link to depgraph if needed 60 60 if links: 61 61 add_ctxtnav(req, 'Depgraph', req.href.depgraph(tkt.id)) 62 62 63 63 for change in data.get('changes', []): 64 for field, field_data in change['fields'].iteritems(): 65 if field in self.fields: 66 if field_data['new'].strip(): 67 new = set([int(n) for n in field_data['new'].split(',')]) 68 else: 69 new = set() 70 if field_data['old'].strip(): 71 old = set([int(n) for n in field_data['old'].split(',')]) 72 else: 73 old = set() 74 add = new - old 75 sub = old - new 76 elms = tag() 77 if add: 78 elms.append( 79 tag.em(u', '.join([unicode(n) for n in sorted(add)])) 80 ) 81 elms.append(u' added') 82 if add and sub: 83 elms.append(u'; ') 84 if sub: 85 elms.append( 86 tag.em(u', '.join([unicode(n) for n in sorted(sub)])) 87 ) 88 elms.append(u' removed') 89 field_data['rendered'] = elms 64 if 'fields' in change: 65 for field, field_data in change['fields'].iteritems(): 66 if field in self.fields: 67 if field_data['new'].strip(): 68 new = set([int(n) for n in field_data['new'].split(',')]) 69 else: 70 new = set() 71 if field_data['old'].strip(): 72 old = set([int(n) for n in field_data['old'].split(',')]) 73 else: 74 old = set() 75 add = new - old 76 sub = old - new 77 elms = tag() 78 if add: 79 elms.append( 80 tag.em(u', '.join([unicode(n) for n in sorted(add)])) 81 ) 82 elms.append(u' added') 83 if add and sub: 84 elms.append(u'; ') 85 if sub: 86 elms.append( 87 tag.em(u', '.join([unicode(n) for n in sorted(sub)])) 88 ) 89 elms.append(u' removed') 90 field_data['rendered'] = elms 90 91 91 92 return template, data, content_type 92 93
Othervise links like /ticket/[ticketname]?action=diff or similiar, where is no fields in changes, produce error messages instead of output.
Attachments (0)
Note: See
TracTickets for help on using
tickets.
Duplicate of #3920