Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #8805 -- Make sure proper type coercion happens before dumping …

…data into join for limit_choices_to when building the URL parameters for the ForeignKeyRawIdWidget popup.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8867 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 577640bd04117573805d8b9ffa4670b999714db4 1 parent 58e3ef7
@brosner brosner authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 django/contrib/admin/widgets.py
View
9 django/contrib/admin/widgets.py
@@ -126,7 +126,14 @@ def render(self, name, value, attrs=None):
def base_url_parameters(self):
params = {}
if self.rel.limit_choices_to:
- params.update(dict([(k, ','.join(v)) for k, v in self.rel.limit_choices_to.items()]))
+ items = []
+ for k, v in self.rel.limit_choices_to.items():
+ if isinstance(v, list):
+ v = [str(x) for x in v]
+ else:
+ v = str(v)
+ items.append((k, ','.join(v)))
+ params.update(dict(items))
return params
def url_parameters(self):
Please sign in to comment.
Something went wrong with that request. Please try again.