From d134f53bb818056f95dd528b4d5d46126ede0f82 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 19 Nov 2024 12:20:50 -0500 Subject: [PATCH] fix: when fetching licenses, return revoked/expired (#594) --- enterprise_access/apps/api_client/license_manager_client.py | 3 ++- enterprise_access/apps/bffs/handlers.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/enterprise_access/apps/api_client/license_manager_client.py b/enterprise_access/apps/api_client/license_manager_client.py index b9b90372..46b4731b 100644 --- a/enterprise_access/apps/api_client/license_manager_client.py +++ b/enterprise_access/apps/api_client/license_manager_client.py @@ -78,7 +78,7 @@ class LicenseManagerUserApiClient(BaseUserApiClient): def auto_apply_license_endpoint(self, customer_agreement_uuid): return f"{self.api_base_url}customer-agreement/{customer_agreement_uuid}/auto-apply/" - def get_subscription_licenses_for_learner(self, enterprise_customer_uuid): + def get_subscription_licenses_for_learner(self, enterprise_customer_uuid, **kwargs): """ Get subscription licenses for a learner. @@ -89,6 +89,7 @@ def get_subscription_licenses_for_learner(self, enterprise_customer_uuid): """ query_params = { 'enterprise_customer_uuid': enterprise_customer_uuid, + **kwargs, } url = self.learner_licenses_endpoint try: diff --git a/enterprise_access/apps/bffs/handlers.py b/enterprise_access/apps/bffs/handlers.py index 03669554..b35df4ce 100644 --- a/enterprise_access/apps/bffs/handlers.py +++ b/enterprise_access/apps/bffs/handlers.py @@ -161,7 +161,9 @@ def load_subscription_licenses(self): """ try: subscriptions_result = self.license_manager_client.get_subscription_licenses_for_learner( - enterprise_customer_uuid=self.context.enterprise_customer_uuid + enterprise_customer_uuid=self.context.enterprise_customer_uuid, + include_revoked=True, + current_plans_only=False, ) subscriptions_data = self.transform_subscriptions_result(subscriptions_result) self.context.data['enterprise_customer_user_subsidies'].update({