From b9ec2564acce44eb7def737916e1ad5a1d6573e2 Mon Sep 17 00:00:00 2001 From: Paurikova2 Date: Thu, 17 Oct 2024 14:00:34 +0200 Subject: [PATCH] fix errors --- src/dspace/_rest.py | 7 ++++--- tools/add_metadata/README.md | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dspace/_rest.py b/src/dspace/_rest.py index 938f187..24b85a2 100644 --- a/src/dspace/_rest.py +++ b/src/dspace/_rest.py @@ -343,12 +343,13 @@ def fetch_items(self): params={"page": page, "size": 100}) if r is None: break - items_data = r.get("items", []) + key = "items" + items_data = r.get(key, []) if items_data: items.extend(items_data) else: - _logger.warning(f"Key [items] does not exist in response: {r}") - page += r + _logger.warning(f"Key [{key}] does not exist in response: {r}") + page += 1 return items def put_ws_item(self, param: dict, data: dict): diff --git a/tools/add_metadata/README.md b/tools/add_metadata/README.md index f489d70..8d983b8 100644 --- a/tools/add_metadata/README.md +++ b/tools/add_metadata/README.md @@ -1,4 +1,4 @@ -# add+metadata.py +# add_metadata.py This script adds new metadata to items that are missing it. The values for this new metadata are taken from the existing input metadata field. ```