fixes Ticket 19536 #1623

Closed
wants to merge 4 commits into
from

Projects

None yet

2 participants

@ikks
ikks commented Sep 12, 2013

added regression test to make sure other actions are shown on change list when add is restricted

@timgraham timgraham commented on the diff Sep 13, 2013
tests/admin_changelist/tests.py
@@ -369,6 +369,18 @@ def test_computed_list_display_localization(self):
self.assertContains(response, formats.localize(event.date))
self.assertNotContains(response, six.text_type(event.date))
+ def test_custom_actions_list_display(self):
@timgraham
timgraham Sep 13, 2013 Django member

This test isn't correct, it passes before any changes are made to the template. Admin actions isn't the problem. I think you'd need to make a custom template that overrides {% block object-tools-items %}

@timgraham timgraham commented on the diff Sep 13, 2013
tests/admin_views/tests.py
@@ -136,9 +136,9 @@ def testBasicEditGetStringPK(self):
def testBasicInheritanceGetStringPK(self):
"""
- Ensure GET on the change_view works on inherited models (returns an
- HTTP 404 error, see #19951) when passing a string as the PK argument
- for a model with an integer PK field.
+ A smoke test to ensure GET on the change_view works on inherited
@timgraham
timgraham Sep 13, 2013 Django member

Please don't include a trivial comment change like this in a file where that's the only change.

@timgraham timgraham commented on the diff Sep 13, 2013
django/contrib/admin/templates/admin/change_list.html
<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>
- {% endblock %}
- </ul>
- {% endif %}
+ {% endif %}
@timgraham
timgraham Sep 13, 2013 Django member

we could have an {% else %} here and then include the empty <li> so we're not always including it.

@timgraham
Member

Please send a new PR if you can update this, thanks!

@timgraham timgraham closed this Nov 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment