Skip to content

Commit

Permalink
Merge 38de73e into 914d7ba
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalp committed Jan 12, 2019
2 parents 914d7ba + 38de73e commit 9c0c398
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions misago/admin/tests/test_generic_admin_list_view.py
Expand Up @@ -37,3 +37,13 @@ def test_unicode_is_preserved_in_redirect_querystring(admin_client):
def test_view_is_not_redirecting_if_flag_is_set_in_querystring(admin_client):
response = admin_client.get("%s?redirected=1" % list_link)
assert response.status_code == 200


def test_restoring_filters_from_session_handles_filters_entry_being_none(admin_client):
"""Regression test for https://github.com/rafalp/Misago/pull/1177"""
response = admin_client.get("%s?set_filters=1&rank=1" % list_link)
assert response.status_code == 302
response = admin_client.get("%s?set_filters=0" % list_link)
assert response.status_code == 302
response = admin_client.get("%s?redirected=1" % list_link)
assert response.status_code == 200
1 change: 1 addition & 0 deletions misago/admin/views/generic/list.py
Expand Up @@ -215,6 +215,7 @@ def get_filtering_method_to_use(self, methods):
for method in ("GET", "session"):
if methods.get(method):
return methods.get(method)
return {}

def apply_filtering_on_context(self, context, active_filters, search_form):
context["active_filters"] = active_filters
Expand Down

0 comments on commit 9c0c398

Please sign in to comment.