From 4d5713cd11ce1045bbbd57cdd43767642be3cee0 Mon Sep 17 00:00:00 2001 From: Ross Poulton Date: Wed, 16 Dec 2009 08:30:50 +0000 Subject: [PATCH] Fixes Issue #122 - infinite loop when most recent ticket was opened in December. Thanks to Chris Vigelius for the bug report. --- CHANGELOG | 3 +++ views/staff.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 4c46e60f..ebbd1d2b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -20,3 +20,6 @@ Patch thanks to hgeerts. 2009-10-13 r143 Issue #113 - Clicking Queue names on the Dashboard was showing all tickets; now only shows open tickets. Thanks to Andreas Kotowicz for the sugestion. + +2009-12-16 r144 Issue #122 - Infinite loop when most recent ticket was +opened in December. Thanks to Chris Vigelius for the report. diff --git a/views/staff.py b/views/staff.py index 945e6f1f..49ca90d6 100644 --- a/views/staff.py +++ b/views/staff.py @@ -765,7 +765,7 @@ def run_report(request, report): if month > 12: year += 1 month = 1 - if month > last_month and year >= last_year: + if (year > last_year) or (month > last_month and year >= last_year): working = False periods.append((temp, (year, month)))