Ticket #4074: 4074.diff

File 4074.diff, 1.2 KB (added by Chris Beaven, 17 years ago)
  • django/contrib/admin/views/main.py

     
    1111from django.db.models.query import handle_legacy_orderlist, QuerySet
    1212from django.http import Http404, HttpResponse, HttpResponseRedirect
    1313from django.utils.html import escape
     14from django.utils.http import urlencode
    1415from django.utils.text import capfirst, get_text_list
    1516from django.utils.encoding import force_unicode, smart_str
    1617from django.utils.translation import ugettext as _
     
    604605                if k.startswith(r):
    605606                    del p[k]
    606607        for k, v in new_params.items():
    607             if k in p and v is None:
    608                 del p[k]
    609             elif v is not None:
     608            if v is None:
     609                if k in p:
     610                    del p[k]
     611            else:
    610612                p[k] = v
    611         return mark_safe('?' + '&'.join([u'%s=%s' % (k, v) for k, v in p.items()]).replace(' ', '%20'))
     613        return '?%s' % urlencode(p)
    612614
    613615    def get_results(self, request):
    614616        paginator = ObjectPaginator(self.query_set, self.lookup_opts.admin.list_per_page)
Back to Top