diff --git a/enterprise_subsidy/apps/content_metadata/api.py b/enterprise_subsidy/apps/content_metadata/api.py index 21f89ffe..04a7b897 100644 --- a/enterprise_subsidy/apps/content_metadata/api.py +++ b/enterprise_subsidy/apps/content_metadata/api.py @@ -246,9 +246,8 @@ def get_content_metadata(content_identifier, **kwargs): course_details, django_cache_timeout=CONTENT_METADATA_CACHE_TIMEOUT, ) - logger.info( - f'Fetched course details {course_details} for content_identifier {content_identifier}', - ) + else: + logger.warning('Could not fetch metadata for content %s', content_identifier) return course_details @staticmethod @@ -273,10 +272,10 @@ def get_content_metadata_for_customer(enterprise_customer_uuid, content_identifi course_details, django_cache_timeout=CONTENT_METADATA_CACHE_TIMEOUT, ) - logger.info( - 'Fetched course details %s for customer %s and content_identifier %s', - course_details, - enterprise_customer_uuid, - content_identifier, - ) + else: + logger.warning( + 'Could not fetch metadata for customer %s, content %s', + enterprise_customer_uuid, + content_identifier, + ) return course_details diff --git a/enterprise_subsidy/apps/fulfillment/api.py b/enterprise_subsidy/apps/fulfillment/api.py index 67628aca..f9ffcd14 100644 --- a/enterprise_subsidy/apps/fulfillment/api.py +++ b/enterprise_subsidy/apps/fulfillment/api.py @@ -99,11 +99,6 @@ def _get_enterprise_customer_data(self, transaction): # Check if data is already cached cached_response = request_cache(namespace=REQUEST_CACHE_NAMESPACE).get_cached_response(cache_key) if cached_response.is_found: - logger.info( - 'subsidy_record cache hit ' - f'enterprise_customer_uuid={self._get_enterprise_customer_uuid(transaction)}, ' - f'subsidy_uuid={transaction.uuid}' - ) return cached_response.value # If data is not cached, fetch and cache it enterprise_customer_uuid = str(self._get_enterprise_customer_uuid(transaction)) @@ -201,6 +196,11 @@ def fulfill(self, transaction): external_reference_id = response_payload.get('orderUuid') if not external_reference_id: raise FulfillmentException('missing orderUuid / external_reference_id from geag') + logger.info( + '[transaction fulfillment] Fulfilled transaction %s with external reference id %s', + transaction.uuid, + external_reference_id, + ) return self._save_fulfillment_reference(transaction, external_reference_id) except HTTPError as exc: raise FulfillmentException(response_payload.get('errors') or geag_response.text) from exc @@ -213,3 +213,8 @@ def cancel_fulfillment(self, external_transaction_reference): self.get_smarter_client().cancel_enterprise_allocation( external_transaction_reference.external_reference_id, ) + logger.info( + '[transaction fulfillment] Cancelled fulfillment for transaction %s with external reference id %s', + external_transaction_reference.transaction.uuid, + external_transaction_reference.external_reference_id, + ) diff --git a/enterprise_subsidy/apps/transaction/api.py b/enterprise_subsidy/apps/transaction/api.py index a5b0b5ae..26dae08e 100644 --- a/enterprise_subsidy/apps/transaction/api.py +++ b/enterprise_subsidy/apps/transaction/api.py @@ -23,7 +23,7 @@ def cancel_transaction_fulfillment(transaction): to the ``audit`` mode). """ if transaction.state != TransactionStateChoices.COMMITTED: - logger.info( + logger.error( "[fulfillment cancelation] %s is not committed, will not cancel fulfillment", transaction.uuid, ) @@ -31,7 +31,7 @@ def cancel_transaction_fulfillment(transaction): "Transaction is not committed" ) if not transaction.fulfillment_identifier: - logger.info( + logger.error( "[fulfillment cancelation] %s has no fulfillment uuid, will not cancel fulfillment", transaction.uuid, )