From 73ec2f0fed9d45eda03c118343082907468f5a47 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 3 Apr 2018 00:19:05 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20issue=20#454.=20Thanks=20to=20Andrei=20Ko?= =?UTF-8?q?rostelev=E2=80=82@kindkaktus=20for=20the=20issue=20and=20the=20?= =?UTF-8?q?solution.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roberto Rosario --- HISTORY.rst | 3 ++- docs/releases/3.0.rst | 1 + mayan/apps/documents/statistics.py | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 5abaccc472..ef6c8feb57 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -108,7 +108,8 @@ - Add support for groups ACLs. - Sort permission namespaces and permissions in the role permission views. - Invert the columns in the ACL detail view. - +- Fix issue #454. Thanks to Andrei Korostelev @kindkaktus for the issue and the + solution. 2.7.3 (2017-09-11) ================== diff --git a/docs/releases/3.0.rst b/docs/releases/3.0.rst index a231a24cd4..8be596c1d8 100644 --- a/docs/releases/3.0.rst +++ b/docs/releases/3.0.rst @@ -423,5 +423,6 @@ Bugs fixed or issues closed =========================== * `GitLab issue #262 `_ Event notifications +* `GitLab issue #454 `_ Invalid next month calculation in statistics app, causes failstop .. _PyPI: https://pypi.python.org/pypi/mayan-edms/ diff --git a/mayan/apps/documents/statistics.py b/mayan/apps/documents/statistics.py index a7b5773101..0a3a37383e 100644 --- a/mayan/apps/documents/statistics.py +++ b/mayan/apps/documents/statistics.py @@ -98,7 +98,7 @@ def total_document_per_month(): for month in range(1, datetime.date.today().month + 1): next_month = month + 1 - if next_month == 12: + if month == 12: next_month = 1 year = this_year + 1 else: @@ -129,7 +129,7 @@ def total_document_version_per_month(): for month in range(1, datetime.date.today().month + 1): next_month = month + 1 - if next_month == 12: + if month == 12: next_month = 1 year = this_year + 1 else: @@ -160,7 +160,7 @@ def total_document_page_per_month(): for month in range(1, datetime.date.today().month + 1): next_month = month + 1 - if next_month == 12: + if month == 12: next_month = 1 year = this_year + 1 else: