From dc6201eeeb8f71158ba34bed650c1d9ea6859806 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Tue, 20 Aug 2019 22:43:51 +0000 Subject: [PATCH] Made sure Person.active_drafts() and .expired_drafts() don't return duplicate entries. Fixes issue #2784. - Legacy-Id: 16665 --- ietf/person/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ietf/person/models.py b/ietf/person/models.py index 6e40686f8..475c55d2e 100644 --- a/ietf/person/models.py +++ b/ietf/person/models.py @@ -168,11 +168,11 @@ class Person(models.Model): def active_drafts(self): from ietf.doc.models import Document - return Document.objects.filter(documentauthor__person=self, type='draft', states__slug='active').order_by('-time') + return Document.objects.filter(documentauthor__person=self, type='draft', states__slug='active').distinct().order_by('-time') def expired_drafts(self): from ietf.doc.models import Document - return Document.objects.filter(documentauthor__person=self, type='draft', states__slug__in=['repl', 'expired', 'auth-rm', 'ietf-rm']).order_by('-time') + return Document.objects.filter(documentauthor__person=self, type='draft', states__slug__in=['repl', 'expired', 'auth-rm', 'ietf-rm']).distinct().order_by('-time') def needs_consent(self): """