Skip to content

Commit 503199e

Browse files
committed
Query unique person objects when searching for duplicates based on aliases. Fixes ietf-tools#2263. Commit ready for merge.
- Legacy-Id: 13978
1 parent 9ff76d0 commit 503199e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ietf/person/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def save(self, *args, **kwargs):
213213
if Alias.objects.filter(name=self.name).exclude(person=self.person).count() > 0 :
214214
msg = render_to_string('person/mail/possible_duplicates.txt',
215215
dict(name=self.name,
216-
persons=Person.objects.filter(alias__name=self.name),
216+
persons=Person.objects.filter(alias__name=self.name).distinct(),
217217
settings=settings
218218
))
219219
send_mail_preformatted(None, msg)

0 commit comments

Comments
 (0)