Skip to content

Commit f1c47d2

Browse files
committed
[soc2009/admin-ui] The Kaplan-Moss commandeth that thou shalt not allow any ol' anonymous user to make arbitrary queries. And so it was done.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/admin-ui@11411 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 81e8b8b commit f1c47d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

django/contrib/admin/views/autocomplete.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from django.utils.encoding import smart_str
55
from django.http import HttpResponse, HttpResponseNotFound
66
from django.conf import settings
7+
from django.contrib.admin.views import staff_member_required
78

89
def foreignkey_autocomplete(request, related_string_functions=None):
910
"""
@@ -55,4 +56,5 @@ def construct_search(field_name):
5556
else:
5657
data = to_string_function(obj)
5758
return HttpResponse(data)
58-
return HttpResponseNotFound()
59+
return HttpResponseNotFound()
60+
foreignkey_autocomplete = staff_member_required(foreignkey_autocomplete)

0 commit comments

Comments
 (0)