Skip to content
Snippets Groups Projects
Commit 5b6e0514 authored by Zia Fazal's avatar Zia Fazal
Browse files

Added caller in to the exception message

Added caller in to the exception message to debug ENT-1849
Replaced `get_enterprise_learner_data` method call with `enterprise_customer_for_request` to get enterprise customer data from cache or session instead of hitting API.
parent b845fae0
No related branches found
No related tags found
No related merge requests found
......@@ -40,8 +40,8 @@ class ContactUsView(View):
if request.user.is_authenticated:
context['course_id'] = request.session.get('course_id', '')
context['user_enrollments'] = CourseEnrollment.enrollments_for_user_with_overviews_preload(request.user)
enterprise_learner_data = enterprise_api.get_enterprise_learner_data(user=request.user)
if enterprise_learner_data:
enterprise_customer = enterprise_api.enterprise_customer_for_request(request)
if enterprise_customer:
tags.append('enterprise_learner')
context['tags'] = tags
......
......@@ -5,6 +5,7 @@ from __future__ import absolute_import
import logging
from functools import wraps
import traceback
from django.conf import settings
from django.contrib.auth.models import User
......@@ -256,9 +257,10 @@ class EnterpriseApiClient(object):
response = endpoint().get(**querystring)
except (HttpClientError, HttpServerError):
LOGGER.exception(
u'Failed to get enterprise-learner for user [%s] with client user [%s]',
u'Failed to get enterprise-learner for user [%s] with client user [%s]. Caller: %s',
user.username,
self.user.username
self.user.username,
"".join(traceback.format_stack())
)
return None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment