Skip to content

Commit 1bb7970

Browse files
committed
Merged [5519] from adam@nostrum.com:
Two changes: (1) searches by substring rather than \'begins with\' (to allow, e.g., searching by last name); and (2) limits results to 10 entries (to limit server load and limit effectiveness of email-scraping attacks) - Legacy-Id: 5531 Note: SVN reference [5519] has been migrated to Git commit 2e740dc
2 parents 52bda85 + 2e740dc commit 1bb7970

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ietf/person/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
from ietf.person.forms import json_emails
55

66
def ajax_search_emails(request):
7-
emails = Email.objects.filter(person__alias__name__istartswith=request.GET.get('q','')).order_by('person__name').distinct()
7+
emails = Email.objects.filter(person__alias__name__icontains=request.GET.get('q','')).filter(active='true').order_by('person__name').distinct()[:10]
88
return HttpResponse(json_emails(emails), mimetype='application/json')

0 commit comments

Comments
 (0)