Skip to content

Commit

Permalink
Update module_versions method to work with app-descriptors paradigm
Browse files Browse the repository at this point in the history
  • Loading branch information
bltravis committed Mar 20, 2024
1 parent e1b018c commit b1cc9d0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion folioclient/FolioClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,14 @@ def identifier_types(self):

@cached_property
def module_versions(self):
resp = self.folio_get(f"/_/proxy/tenants/{self.tenant_id}/modules")
try:
resp = self.folio_get(f"/_/proxy/tenants/{self.tenant_id}/modules")
except httpx.HTTPError:
entitlements = self.folio_get(f"/entitlements/{self.tenant_id}/applications")
resp = []
for app in entitlements["applicationDescriptors"]:
for md in app["modules"]:
resp.append(md)
return [a["id"] for a in resp]

@cached_property
Expand Down

0 comments on commit b1cc9d0

Please sign in to comment.