From 7c38300949c269a1a56c0240407274f526a318e3 Mon Sep 17 00:00:00 2001 From: Rishi Gupta Date: Sun, 23 Dec 2018 15:35:48 -0800 Subject: [PATCH] billing: Add info line to logger for failed upgrades. --- corporate/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/corporate/views.py b/corporate/views.py index 1f5e97d261..cbcf512e73 100644 --- a/corporate/views.py +++ b/corporate/views.py @@ -95,7 +95,12 @@ def upgrade(request: HttpRequest, user: UserProfile, 'monthly': CustomerPlan.MONTHLY}[schedule] process_initial_upgrade(user, licenses, automanage_licenses, billing_schedule, stripe_token) except BillingError as e: - # TODO add a billing_logger.warning with all the upgrade parameters + if not settings.TEST_SUITE: # nocoverage + billing_logger.info( + ("BillingError during upgrade: %s. user=%s, billing_modality=%s, schedule=%s, " + "license_management=%s, licenses=%s, has stripe_token: %s") + % (e.description, user.id, billing_modality, schedule, license_management, licenses, + stripe_token is not None)) return json_error(e.message, data={'error_description': e.description}) except Exception as e: billing_logger.exception("Uncaught exception in billing: %s" % (e,))