Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions osf_pigeon/pigeon.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async def get_metadata_for_ia_item(json_metadata):
get_relationship_attribute(
"creator",
f'{settings.OSF_API_URL}v2/registrations/{json_metadata["data"]["id"]}/contributors/'
f"?filter[bibliographic]=true&",
f"?filter[bibliographic]=true",
get_contributor_info,
),
get_relationship_attribute(
Expand Down Expand Up @@ -224,7 +224,8 @@ async def get_with_retry(url, retry_on=(), sleep_period=None, headers=None):
async def get_pages(url, page, result=None, parse_json=None, semaphore=None):
if result is None:
result = {}
url = f"{url}?page={page}&page={page}"
separator = "&" if "?" in url else "?"
url = f"{url}{separator}page={page}"
data = {}
if semaphore is None:
data = await get_with_retry(url, retry_on=(429,))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pigeon.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ async def test_stream_files_to_dir(
body=page1,
)
m.get(
f"{settings.OSF_API_URL}v2/registrations/{guid}/wikis/?page=2&page=2",
f"{settings.OSF_API_URL}v2/registrations/{guid}/wikis/?page=2",
body=page2,
)
with tempfile.TemporaryDirectory() as temp_dir:
Expand Down
Loading