1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #19536 -- Included object-tools when ModelAdmin.has_add_permission() is False.

This commit is contained in:
Nick Sandford
2015-11-07 11:31:06 +00:00
committed by Tim Graham
parent d9e150b311
commit ff19df9c2d
4 changed files with 27 additions and 5 deletions

View File

@@ -40,18 +40,18 @@
{% block content %}
<div id="content-main">
{% block object-tools %}
{% if has_add_permission %}
<ul class="object-tools">
{% block object-tools-items %}
{% if has_add_permission %}
<li>
{% url cl.opts|admin_urlname:'add' as add_url %}
<a href="{% add_preserved_filters add_url is_popup to_field %}" class="addlink">
{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
</a>
</li>
{% endif %}
{% endblock %}
</ul>
{% endif %}
{% endblock %}
{% if cl.formset.errors %}
<p class="errornote">