diff --git a/django/utils/http.py b/django/utils/http.py index d77bfb5992..b6a78184a6 100644 --- a/django/utils/http.py +++ b/django/utils/http.py @@ -116,7 +116,7 @@ def urlencode(query, doseq=False): 'Cannot encode None in a query string. Did you mean to pass ' 'an empty string or omit the value?' ) - elif isinstance(value, (str, bytes)) or not doseq: + elif not doseq or isinstance(value, (str, bytes)): query_val = value else: try: