From b79bb6ac10ae0b0ca73a19713a38fa644cf5fcec Mon Sep 17 00:00:00 2001 From: Andreas Kotowicz Date: Thu, 8 Dec 2011 16:49:17 +0100 Subject: [PATCH] fix /reports/usermonth/ & /reports/queuemonth/ errors - indexing was wrong - wrong first month label was used. --- helpdesk/views/staff.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index f9c9269e..b792094e 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -881,7 +881,7 @@ def run_report(request, report): periods = [] year, month = first_year, first_month working = True - periods.append("%s %s" % (months[month], year)) + periods.append("%s %s" % (months[month - 1], year)) while working: month += 1 @@ -951,7 +951,7 @@ def run_report(request, report): elif report == 'usermonth': metric1 = u'%s' % ticket.get_assigned_to - metric2 = u'%s %s' % (months[ticket.created.month], ticket.created.year) + metric2 = u'%s %s' % (months[ticket.created.month - 1], ticket.created.year) elif report == 'queuepriority': metric1 = u'%s' % ticket.queue.title @@ -963,14 +963,14 @@ def run_report(request, report): elif report == 'queuemonth': metric1 = u'%s' % ticket.queue.title - metric2 = u'%s %s' % (months[ticket.created.month], ticket.created.year) + metric2 = u'%s %s' % (months[ticket.created.month - 1], ticket.created.year) summarytable[metric1, metric2] += 1 table = [] header1 = sorted(set(list( i.encode('utf-8') for i,_ in summarytable.keys() ))) - + column_headings = [col1heading] + possible_options # Pivot the data so that 'header1' fields are always first column