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 2e740dcab8
This commit is contained in:
commit
1bb79708e6
|
@ -4,5 +4,5 @@ from ietf.person.models import *
|
|||
from ietf.person.forms import json_emails
|
||||
|
||||
def ajax_search_emails(request):
|
||||
emails = Email.objects.filter(person__alias__name__istartswith=request.GET.get('q','')).order_by('person__name').distinct()
|
||||
emails = Email.objects.filter(person__alias__name__icontains=request.GET.get('q','')).filter(active='true').order_by('person__name').distinct()[:10]
|
||||
return HttpResponse(json_emails(emails), mimetype='application/json')
|
||||
|
|
Loading…
Reference in a new issue