From 19ed162e58136f9b0c2833504a16b83501cec892 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 1 Jan 2018 11:47:23 +0100 Subject: [PATCH] fixes invalid 'is_older' method on EnregistrementRecursif --- core/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/models.py b/core/models.py index ea31af0..4bea972 100644 --- a/core/models.py +++ b/core/models.py @@ -104,8 +104,9 @@ class EnregistrementRecursif(models.Model): ordering = ('jour',) def is_older(self, month, year): - return (self.created_date.month <= month - and self.created_date.year <= year) + return (self.created_date.year < year + or (self.created_date.month < month + and self.created_date.year == year)) def spawn(self, month, year, commit=True): """ Spawn a new Enregistrement for given month and year. """