Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed incorrect URL to object on delete confirmation and history page

  • Loading branch information...
commit a222d6e80029de772a291e18460d96dcfbd23570 1 parent b0eee0b
Luke Plant authored
2  django/contrib/admin/templates/admin/delete_confirmation.html
@@ -7,7 +7,7 @@
7 7
 <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
8 8
 &rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ app_label|capfirst }}</a>
9 9
 &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
10  
-&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a>
  10
+&rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
11 11
 &rsaquo; {% trans 'Delete' %}
12 12
 </div>
13 13
 {% endblock %}
2  django/contrib/admin/templates/admin/object_history.html
@@ -7,7 +7,7 @@
7 7
 <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
8 8
 &rsaquo; <a href="{% url 'admin:app_list' app_label=app_label %}">{{ app_label|capfirst|escape }}</a>
9 9
 &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
10  
-&rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk %}">{{ object|truncatewords:"18" }}</a>
  10
+&rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
11 11
 &rsaquo; {% trans 'History' %}
12 12
 </div>
13 13
 {% endblock %}
8  django/contrib/admin/templatetags/admin_urls.py
... ...
@@ -1,8 +1,14 @@
1  
-from django.core.urlresolvers import reverse, NoReverseMatch
  1
+from django.core.urlresolvers import reverse
2 2
 from django import template
  3
+from django.contrib.admin.util import quote
3 4
 
4 5
 register = template.Library()
5 6
 
6 7
 @register.filter
7 8
 def admin_urlname(value, arg):
8 9
     return 'admin:%s_%s_%s' % (value.app_label, value.module_name, arg)
  10
+
  11
+
  12
+@register.filter
  13
+def admin_urlquote(value):
  14
+    return quote(value)

0 notes on commit a222d6e

Please sign in to comment.
Something went wrong with that request. Please try again.