mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix bug with ?_next=x&_sort=rowid, closes #1470
This commit is contained in:
parent
1163da8916
commit
875117c343
2 changed files with 10 additions and 2 deletions
|
|
@ -588,13 +588,15 @@ class TableView(RowTableShared):
|
|||
_next = _next or special_args.get("_next")
|
||||
offset = ""
|
||||
if _next:
|
||||
sort_value = None
|
||||
if is_view:
|
||||
# _next is an offset
|
||||
offset = f" offset {int(_next)}"
|
||||
else:
|
||||
components = urlsafe_components(_next)
|
||||
# If a sort order is applied, the first of these is the sort value
|
||||
if sort or sort_desc:
|
||||
# If a sort order is applied and there are multiple components,
|
||||
# the first of these is the sort value
|
||||
if (sort or sort_desc) and (len(components) > 1):
|
||||
sort_value = components[0]
|
||||
# Special case for if non-urlencoded first token was $null
|
||||
if _next.split(",")[0] == "$null":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue