Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

unicode: Fixed #4315 -- Fixed a problem with passing unicode strings …

…as keyword

arguments in a function call (so admin list_filters work again now).


git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5270 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1ad97d0634dda512f294d5116a1dba91789b8817 1 parent abba09c
@malcolmt malcolmt authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 django/contrib/admin/views/main.py
View
8 django/contrib/admin/views/main.py
@@ -12,7 +12,7 @@
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.utils.html import escape
from django.utils.text import capfirst, get_text_list
-from django.utils.encoding import smart_unicode
+from django.utils.encoding import smart_unicode, smart_str
from django.utils.translation import ugettext as _
import operator
@@ -686,6 +686,12 @@ def get_query_set(self):
for i in (ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR):
if i in lookup_params:
del lookup_params[i]
+ for key, value in lookup_params.items():
+ if not isinstance(key, str):
+ # 'key' will be used as a keyword argument later, so Python
+ # requires it to be a string.
+ del lookup_params[key]
+ lookup_params[smart_str(key)] = value
# Apply lookup parameters from the query string.
qs = qs.filter(**lookup_params)
Please sign in to comment.
Something went wrong with that request. Please try again.