File tree Expand file tree Collapse file tree 3 files changed +2
-21
lines changed
Expand file tree Collapse file tree 3 files changed +2
-21
lines changed Original file line number Diff line number Diff line change @@ -134,9 +134,6 @@ async def all_collections( # noqa: C901
134134
135135 linked_collections .append (coll )
136136
137- if not collections :
138- next_link = None
139-
140137 links = await CollectionSearchPagingLinks (
141138 request = request ,
142139 next = next_link ,
Original file line number Diff line number Diff line change @@ -206,23 +206,7 @@ def link_prev(self):
206206 if self .prev is not None :
207207 method = self .request .method
208208 if method == "GET" :
209- u = urlparse (self .url )
210- params = parse_qs (u .query )
211- params .update (self .prev ["body" ])
212-
213- # if offset is equal to default value (0), drop it
214- if params .get ("offset" , - 1 ) == 0 :
215- _ = params .pop ("offset" )
216-
217- param_string = unquote (urlencode (params , True ))
218- href = ParseResult (
219- scheme = u .scheme ,
220- netloc = u .netloc ,
221- path = u .path ,
222- params = u .params ,
223- query = param_string ,
224- fragment = u .fragment ,
225- ).geturl ()
209+ href = merge_params (self .url , self .prev ["body" ])
226210
227211 # if prev link is equal to this link, skip it
228212 if href == self .url :
Original file line number Diff line number Diff line change @@ -469,7 +469,7 @@ async def test_get_collections_search_pagination(
469469 assert len (links ) == 3
470470 assert {"root" , "self" , "previous" } == {link ["rel" ] for link in links }
471471 prev_link = list (filter (lambda link : link ["rel" ] == "previous" , links ))[0 ]
472- assert "offset" not in prev_link ["href" ]
472+ assert "offset" in prev_link ["href" ]
473473
474474 ###################
475475 # offset=0, should not have next/previous link
You can’t perform that action at this time.
0 commit comments