File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -46,13 +46,12 @@ def fetch_pretalx_data(
4646 # Pretalx paginates the output, so we will need to do multiple requests and
4747 # then merge multiple pages to one big dictionary
4848 results = []
49- data = {"next" : url }
5049 page = 0
5150
52- # This takes advantage of the fact that "next" will contain a url to the
51+ # This takes advantage of the fact that url will contain a url to the
5352 # next page, until there is more data to fetch. If this is the last page,
54- # then the data["next"] will be None (falsy), and thus stop the while loop.
55- while url := data [ "next" ] :
53+ # then the url will be None (falsy), and thus stop the while loop.
54+ while url :
5655 page += 1
5756 response = httpx .get (url , headers = headers )
5857
@@ -64,6 +63,7 @@ def fetch_pretalx_data(
6463
6564 data = response .json ()
6665 results += data ["results" ]
66+ url = data ["next" ]
6767
6868 return results
6969
You can’t perform that action at this time.
0 commit comments