Don't duplicate _sort_desc, refs #1738

This commit is contained in:
Simon Willison 2022-08-14 09:13:12 -07:00
commit 1563c22a8c
2 changed files with 2 additions and 1 deletions

View file

@ -710,7 +710,7 @@ class TableView(DataView):
for key in request.args: for key in request.args:
if ( if (
key.startswith("_") key.startswith("_")
and key not in ("_sort", "_search", "_next") and key not in ("_sort", "_sort_desc", "_search", "_next")
and "__" not in key and "__" not in key
): ):
for value in request.args.getlist(key): for value in request.args.getlist(key):

View file

@ -828,6 +828,7 @@ def test_other_hidden_form_fields(app_client, path, expected_hidden):
[ [
("/fixtures/searchable?_search=terry", []), ("/fixtures/searchable?_search=terry", []),
("/fixtures/searchable?_sort=text2", []), ("/fixtures/searchable?_sort=text2", []),
("/fixtures/searchable?_sort_desc=text2", []),
("/fixtures/searchable?_sort=text2&_where=1", [("_where", "1")]), ("/fixtures/searchable?_sort=text2&_where=1", [("_where", "1")]),
], ],
) )