Code

Ticket #11252: django_admin_pagination_fixamperstands.patch

File django_admin_pagination_fixamperstands.patch, 1.2 KB (added by daemondazz, 5 years ago)

Patch to wrap the return of urllib.urlencode in fix_amperstands

  • django/contrib/admin/templatetags/admin_list.py

     
    44from django.core.exceptions import ObjectDoesNotExist 
    55from django.db import models 
    66from django.utils import dateformat 
    7 from django.utils.html import escape, conditional_escape 
     7from django.utils.html import escape, conditional_escape, fix_ampersands 
    88from django.utils.text import capfirst 
    99from django.utils.safestring import mark_safe 
    1010from django.utils.translation import get_date_formats, get_partial_date_formats, ugettext as _ 
     
    2222    elif i == cl.page_num: 
    2323        return mark_safe(u'<span class="this-page">%d</span> ' % (i+1)) 
    2424    else: 
    25         return mark_safe(u'<a href="%s"%s>%d</a> ' % (cl.get_query_string({PAGE_VAR: i}), (i == cl.paginator.num_pages-1 and ' class="end"' or ''), i+1)) 
     25        return mark_safe(u'<a href="%s"%s>%d</a> ' % (fix_ampersands(cl.get_query_string({PAGE_VAR: i})), (i == cl.paginator.num_pages-1 and ' class="end"' or ''), i+1)) 
    2626paginator_number = register.simple_tag(paginator_number) 
    2727 
    2828def pagination(cl):