Skip to content

Commit

Permalink
unicode: Fixed #4315 -- Fixed a problem with passing unicode strings …
Browse files Browse the repository at this point in the history
…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
malcolmt committed May 16, 2007
1 parent abba09c commit 1ad97d0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion django/contrib/admin/views/main.py
Expand Up @@ -12,7 +12,7 @@
from django.http import Http404, HttpResponse, HttpResponseRedirect from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.utils.html import escape from django.utils.html import escape
from django.utils.text import capfirst, get_text_list 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 _ from django.utils.translation import ugettext as _
import operator import operator


Expand Down Expand Up @@ -686,6 +686,12 @@ def get_query_set(self):
for i in (ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR): for i in (ALL_VAR, ORDER_VAR, ORDER_TYPE_VAR, SEARCH_VAR, IS_POPUP_VAR):
if i in lookup_params: if i in lookup_params:
del lookup_params[i] 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. # Apply lookup parameters from the query string.
qs = qs.filter(**lookup_params) qs = qs.filter(**lookup_params)
Expand Down

0 comments on commit 1ad97d0

Please sign in to comment.