Skip to content

Commit d7f648d

Browse files
authored
Fix wrong if-statement in get_items
Fixes a wrong if-statement in get_items that lead to an always empty list. The statement checked for the dictionary key 'collections' which is never there and always returns false. The correct way is to check for the 'items' key.
1 parent 3aa1c8f commit d7f648d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dspace_rest_client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ def get_items(self):
844844
items = list()
845845
if '_embedded' in r_json:
846846
# This is a list of items
847-
if 'collections' in r_json['_embedded']:
847+
if 'items' in r_json['_embedded']:
848848
for item_resource in r_json['_embedded']['items']:
849849
items.append(Item(item_resource))
850850
elif 'uuid' in r_json:

0 commit comments

Comments
 (0)