fix /reports/usermonth/ & /reports/queuemonth/ errors

- indexing was wrong
- wrong first month label was used.
This commit is contained in:
Andreas Kotowicz 2011-12-08 16:49:17 +01:00
parent 50406665c9
commit b79bb6ac10

View File

@ -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