Code

Ticket #4074: django-4074-admin-querystring-quote.patch

File django-4074-admin-querystring-quote.patch, 768 bytes (added by Robert Bunting, 7 years ago)

One way to patch it - saves lots of potential problems with the query string

  • main.py

     
     1import urllib 
    12from django import oldforms, template 
    23from django.conf import settings 
    34from django.contrib.admin.filterspecs import FilterSpec 
     
    604605                del p[k] 
    605606            elif v is not None: 
    606607                p[k] = v 
    607         return '?' + '&'.join([u'%s=%s' % (k, v) for k, v in p.items()]).replace(' ', '%20') 
     608        return '?' + '&'.join([u'%s=%s' % (urllib.quote(str(k)), urllib.quote(str(v))) for k, v in p.items()]).replace(' ', '%20') 
    608609 
    609610    def get_results(self, request): 
    610611        paginator = ObjectPaginator(self.query_set, self.lookup_opts.admin.list_per_page)