Commits

bro...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed 5238da6

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.

  • Participants
  • Parent commits 6b3ea6f

Comments (0)

Files changed (1)

File django/contrib/admin/widgets.py

     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):