Skip to content

Commit 73b886e

Browse files
authored
Merge pull request #10 from dataquest-dev/add_group_to_rp
add group info to resourcePolicy
2 parents 5c4e9f0 + 259a975 commit 73b886e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

dspace_rest_client/models.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,12 @@ def __init__(self, api_resource: dict):
532532
self.type = api_resource.get('type')
533533
self.action = api_resource.get('action')
534534
self.policyType = api_resource.get('policyType')
535-
535+
self.groupName = None
536+
self.groupUUID = None
537+
if '_embedded' in api_resource:
538+
if 'group' in api_resource['_embedded']:
539+
self.groupName = api_resource['_embedded']['group'].get('name')
540+
self.groupUUID = api_resource['_embedded']['group'].get('uuid')
536541
def as_dict(self):
537542
return {
538543
'id': self.id,
@@ -543,4 +548,6 @@ def as_dict(self):
543548
'endDate': self.endDate,
544549
'action': self.action,
545550
'policyType': self.policyType,
551+
'groupName': self.groupName,
552+
'groupUUID': self.groupUUID,
546553
}

0 commit comments

Comments
 (0)