diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-04-11 07:41:59 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2009-04-11 07:41:59 +0000 |
| commit | 3bd384aa62608ca2aebdf6d86ae1a75abb96f4bf (patch) | |
| tree | 2a1168b110a3802532436be0c93a8375083cfb8e /django/contrib/admin/views | |
| parent | d2fc8ae0e3f1a17e1e0df129431b54a9dff99638 (diff) | |
Fixed #10645 -- Added some robustness around some admin and modelform params.
Fieldset dictionary names, search fields and unique_together attribute
names all have to be convertible to strings (that has always been true).
If somebody passes in a unicode object, Python barfs because Django uses
those values as keyword argument names and function calls require
parameter names to be str objects. We now convert thing to strs
automatically.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10510 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/admin/views')
| -rw-r--r-- | django/contrib/admin/views/main.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 9580e912a4..49b18ebdfd 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -228,7 +228,7 @@ class ChangeList(object): if self.search_fields and self.query: for bit in self.query.split(): - or_queries = [models.Q(**{construct_search(field_name): bit}) for field_name in self.search_fields] + or_queries = [models.Q(**{construct_search(str(field_name)): bit}) for field_name in self.search_fields] other_qs = QuerySet(self.model) other_qs.dup_select_related(qs) other_qs = other_qs.filter(reduce(operator.or_, or_queries)) |
