Skip to content

Commit

Permalink
Merge branch 'main' into wip/retrieve-oaps-instead-of-just-resource-iris
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum authored Oct 3, 2023
2 parents 348737d + c4718ec commit 3640559
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dsp_permissions_scripts/utils/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def __get_all_resource_oaps_of_resclass(
more, iris = __get_next_page(
protocol=protocol,
host=host,
resclass=resclass_iri,
resclass_iri=resclass_iri,
page=page,
headers=headers,
)
Expand All @@ -126,7 +126,7 @@ def __get_all_resource_oaps_of_resclass(
def __get_next_page(
protocol: str,
host: str,
resclass: str,
resclass_iri: str,
page: int,
headers: dict[str, str],
) -> tuple[bool, list[Oap]]:
Expand All @@ -139,7 +139,7 @@ def __get_next_page(
and an empty response content with status code 200 if there are no resources remaining.
This means that the page must be incremented until the response contains 0 or 1 resource.
"""
url = f"{protocol}://{host}/v2/resources?resourceClass={quote_plus(resclass)}&page={page}"
url = f"{protocol}://{host}/v2/resources?resourceClass={quote_plus(resclass_iri)}&page={page}"
response = requests.get(url, headers=headers, timeout=5)
assert response.status_code == 200
result = response.json()
Expand Down

0 comments on commit 3640559

Please sign in to comment.