Skip to content

Commit dc6201e

Browse files
committed
Made sure Person.active_drafts() and .expired_drafts() don't return duplicate entries. Fixes issue ietf-tools#2784.
- Legacy-Id: 16665
1 parent 50d2160 commit dc6201e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ietf/person/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ def rfcs(self):
168168

169169
def active_drafts(self):
170170
from ietf.doc.models import Document
171-
return Document.objects.filter(documentauthor__person=self, type='draft', states__slug='active').order_by('-time')
171+
return Document.objects.filter(documentauthor__person=self, type='draft', states__slug='active').distinct().order_by('-time')
172172

173173
def expired_drafts(self):
174174
from ietf.doc.models import Document
175-
return Document.objects.filter(documentauthor__person=self, type='draft', states__slug__in=['repl', 'expired', 'auth-rm', 'ietf-rm']).order_by('-time')
175+
return Document.objects.filter(documentauthor__person=self, type='draft', states__slug__in=['repl', 'expired', 'auth-rm', 'ietf-rm']).distinct().order_by('-time')
176176

177177
def needs_consent(self):
178178
"""

0 commit comments

Comments
 (0)