Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #19536 -- Show object-tools when has_add_permission is False. #5573

Closed
wants to merge 1 commit into from

Conversation

slurms
Copy link
Contributor

@slurms slurms commented Nov 7, 2015

No description provided.

@@ -35,6 +35,8 @@ Minor features
* For sites running on a subpath, the default :attr:`URL for the "View site"
link <django.contrib.admin.AdminSite.site_url>` at the top of each admin page
will now point to ``request.META['SCRIPT_NAME']`` if set, instead of ``/``.
* On a ``ModelAdmin``'s changelist, if a user has no add permission the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing blank line above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed :).

m = EventAdmin(Event, custom_site)
request = self._mocked_authenticated_request('/event/', superuser)
response = m.changelist_view(request)
self.assertIn('<ul class="object-tools">', response.rendered_content)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also assert that "Add {{ name }}" isn't shown? If there's already a test for that, maybe we could simply modify that one?

@timgraham
Copy link
Member

Hi Nick, do you have time to follow up on this or at least response to my question about the <li style="display: none"></li>? I can fix the other cosmetic comments when merging. Thanks!

@timgraham
Copy link
Member

merged in ff19df9, thanks!

@timgraham timgraham closed this Dec 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants