Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unused param #140

Merged
merged 1 commit into from
Sep 11, 2024
Merged
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
10 changes: 4 additions & 6 deletions dsp_permissions_scripts/oap/oap_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@


def _update_permissions_for_value(
resource_iri: str,
value: ValueOap,
resource_type: str,
context: dict[str, str],
dsp_client: DspClient,
) -> None:
"""Updates the permissions for the given value (of a property) on a DSP server"""
payload = {
"@id": resource_iri,
"@id": value.resource_iri,
"@type": resource_type,
value.property: {
"@id": value.value_iri,
Expand All @@ -37,11 +36,11 @@ def _update_permissions_for_value(
}
try:
dsp_client.put("/v2/values", data=payload)
logger.info(f"Updated permissions of resource {resource_iri}, value {value.value_iri}")
logger.info(f"Updated permissions of resource {value.resource_iri}, value {value.value_iri}")
except PermissionsAlreadyUpToDate:
logger.warning(f"Permissions of resource {resource_iri}, value {value.value_iri} are already up to date")
logger.warning(f"Permissions of resource {value.resource_iri}, value {value.value_iri} are already up to date")
except ApiError as err:
err.message = f"Error while updating permissions of resource {resource_iri}, value {value.value_iri}"
err.message = f"Error while updating permissions of resource {value.resource_iri}, value {value.value_iri}"
raise err from None


Expand Down Expand Up @@ -101,7 +100,6 @@ def _update_batch(batch: tuple[ModifiedOap, ...], dsp_client: DspClient) -> list
for val_oap in oap.value_oaps:
try:
_update_permissions_for_value(
resource_iri=val_oap.resource_iri,
value=val_oap,
resource_type=resource["@type"],
context=resource["@context"] | {"knora-admin": KNORA_ADMIN_ONTO_NAMESPACE},
Expand Down