Code

Ticket #12140: urlencode.diff

File urlencode.diff, 504 bytes (added by aneil, 5 years ago)

urlencode empty list bug patch

Line 
1Index: django/utils/http.py
2===================================================================
3--- django/utils/http.py        (revision 11708)
4+++ django/utils/http.py        (working copy)
5@@ -38,7 +38,7 @@
6         query = query.items()
7     return urllib.urlencode(
8         [(smart_str(k),
9-         isinstance(v, (list,tuple)) and [smart_str(i) for i in v] or smart_str(v))
10+         [smart_str(i) for i in v] if isinstance(v, (list,tuple)) else smart_str(v))
11             for k, v in query],
12         doseq)
13