Skip to content

Commit

Permalink
Handle the page number as the first API parameter.
Browse files Browse the repository at this point in the history
Handle the case where the page number is the first API parameter.
  • Loading branch information
drsmith2 authored and ktdreyer committed Jun 4, 2024
1 parent e941f54 commit 25489e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion errata_tool/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ def get_paginated_data(self, api_url):
# pages yet, but if we do, we could raise this limit.
PAGE_LIMIT = 50
page_number = 1
tmpl = api_url + '&page[number]=%d'
# If 'page' is the first API parameter, it must start with '?'
if api_url.find('?') < 0:
tmpl = api_url + '?page[number]=%d'
else:
tmpl = api_url + '&page[number]=%d'
data = []
paged_data = []
while(page_number == 1 or paged_data):
Expand Down

0 comments on commit 25489e0

Please sign in to comment.