• R/O
  • SSH
  • HTTPS

shibuya-trac: Commit


Commit MetaInfo

Revision856 (tree)
Zeit2014-09-01 21:00:49
Autorjun66j5

Log Message

GanttCalendarPlugin: avoid KeyError: 'custom' in /ticketgantt page

Ändern Zusammenfassung

Diff

--- plugins/ganttcalendarplugin/trunk/ganttcalendar/ticketgantt.py (revision 855)
+++ plugins/ganttcalendarplugin/trunk/ganttcalendar/ticketgantt.py (revision 856)
@@ -307,7 +307,7 @@
307307
308308 ###### get_sql
309309 custom_join = ""
310- custom_fields = [f['name'] for f in fields if 'custom' in f]
310+ custom_fields = [f['name'] for f in fields if f.get('custom')]
311311
312312 # Join with ticket_custom table as necessary
313313 for k in [k for k in constraint_cols if k in custom_fields]:
@@ -493,7 +493,7 @@
493493
494494 if sorted_field not in ('due_assign', 'due_close', 'complete',
495495 'estimatedhours', 'totalhours') and \
496- any(f['name'] == sorted_field and f['custom'] for f in fields):
496+ any(f['name'] == sorted_field and f.get('custom') for f in fields):
497497 sort_expr = "(SELECT tc.value FROM ticket_custom tc " \
498498 "WHERE tc.ticket=t.id AND name=%s LIMIT 1)"
499499 args.append(sorted_field)
Show on old repository browser