From b8e16428d87c3664d0229f8f97b47e1b8340cef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= Date: Wed, 28 Jan 2015 18:10:13 -0600 Subject: [PATCH] rrs/models.py: fix RecipeMaintainerHistory get_by_end_date. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If not maintainer info is found return None instead of the first one entry in the table, this made reporting more consistency. Signed-off-by: Aníbal Limón --- rrs/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rrs/models.py b/rrs/models.py index 5c9bcc0..366bb6b 100644 --- a/rrs/models.py +++ b/rrs/models.py @@ -106,7 +106,7 @@ class RecipeMaintainerHistory(models.Model): if rmh_qry: return rmh_qry[0] else: - return RecipeMaintainerHistory.objects.filter().order_by('date')[0] + return None def __unicode__(self): return "%s: %s, %s" % (self.date, self.author.name, self.sha1[:10])