Fixed incorrect URL to object on delete confirmation and history page
This commit is contained in:
parent
b0eee0ba4b
commit
a222d6e800
|
@ -7,7 +7,7 @@
|
|||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ app_label|capfirst }}</a>
|
||||
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst|escape }}</a>
|
||||
› <a href="{% url opts|admin_urlname:'changelist' %}{{ object.pk }}">{{ object|truncatewords:"18" }}</a>
|
||||
› <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
|
||||
› {% trans 'Delete' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
|
||||
› <a href="{% url 'admin:app_list' app_label=app_label %}">{{ app_label|capfirst|escape }}</a>
|
||||
› <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
|
||||
› <a href="{% url opts|admin_urlname:'change' object.pk %}">{{ object|truncatewords:"18" }}</a>
|
||||
› <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
|
||||
› {% trans 'History' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
from django.core.urlresolvers import reverse, NoReverseMatch
|
||||
from django.core.urlresolvers import reverse
|
||||
from django import template
|
||||
from django.contrib.admin.util import quote
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@register.filter
|
||||
def admin_urlname(value, arg):
|
||||
return 'admin:%s_%s_%s' % (value.app_label, value.module_name, arg)
|
||||
|
||||
|
||||
@register.filter
|
||||
def admin_urlquote(value):
|
||||
return quote(value)
|
||||
|
|
Loading…
Reference in New Issue