1
0
mirror of https://github.com/django/django.git synced 2025-10-25 14:46:09 +00:00

Fixed #31597, #31603 -- Corrected admin clear all filters link behavior.

- Show "Clear all filters" only when any filter is selected.
- Preserve query string not related with filters.

Co-Authored-By: Hasan Ramezani <hasan.r67@gmail.com>
This commit is contained in:
Fran Hrzenjak
2020-05-19 09:03:04 +02:00
committed by Mariusz Felisiak
parent 3460ea49e8
commit 4484bc1b2f
5 changed files with 110 additions and 16 deletions

View File

@@ -21,7 +21,7 @@ class DateHierarchyTests(TestCase):
request = self.factory.get('/', query)
request.user = self.superuser
changelist = EventAdmin(Event, custom_site).get_changelist_instance(request)
_, _, lookup_params, _ = changelist.get_filters(request)
_, _, lookup_params, *_ = changelist.get_filters(request)
self.assertEqual(lookup_params['date__gte'], expected_from_date)
self.assertEqual(lookup_params['date__lt'], expected_to_date)