Ticket #9586: admin.patch

File admin.patch, 943 bytes (added by eibaan, 6 years ago)
  • django/contrib/admin/widgets.py

     
    1111from django.utils.translation import ugettext as _
    1212from django.utils.safestring import mark_safe
    1313from django.utils.encoding import force_unicode
     14from django.utils.http import urlquote
    1415from django.conf import settings
    1516
    1617class FilteredSelectMultiple(forms.SelectMultiple):
     
    9192        output = []
    9293        if value and hasattr(value, "url"):
    9394            output.append('%s <a target="_blank" href="%s">%s</a> <br />%s ' % \
    94                 (_('Currently:'), value.url, value, _('Change:')))
     95                (_('Currently:'), urlquote(value.url), value, _('Change:')))
    9596        output.append(super(AdminFileWidget, self).render(name, value, attrs))
    9697        return mark_safe(u''.join(output))
    9798
Back to Top