Skip to content
Snippets Groups Projects
Unverified Commit aa3119e4 authored by Zainab Amir's avatar Zainab Amir Committed by GitHub
Browse files

Add new relic metrics (#26003)

parent d9174fc0
Branches
Tags release-2021-01-05-15.23
No related merge requests found
......@@ -467,6 +467,8 @@ def login_user(request):
except AuthFailedError as e:
set_custom_attribute('login_user_tpa_success', False)
set_custom_attribute('login_user_tpa_failure_msg', e.value)
if e.error_code:
set_custom_attribute('login_error_code', e.error_code)
# user successfully authenticated with a third party provider, but has no linked Open edX account
response_content = e.get_response()
......@@ -512,7 +514,12 @@ def login_user(request):
except AuthFailedError as error:
response_content = error.get_response()
log.exception(response_content)
if response_content.get('error_code') == 'inactive-user':
error_code = response_content.get('error_code')
if error_code:
set_custom_attribute('login_error_code', error_code)
if error_code == 'inactive-user':
response_content['email'] = user.email
response = JsonResponse(response_content, status=400)
......
......@@ -21,6 +21,7 @@ from django.utils.translation import get_language
from django.utils.translation import ugettext as _
from django.views.decorators.csrf import csrf_exempt, ensure_csrf_cookie
from django.views.decorators.debug import sensitive_post_parameters
from edx_django_utils.monitoring import set_custom_attribute
from edx_toggles.toggles import LegacyWaffleFlag, LegacyWaffleFlagNamespace
from pytz import UTC
from ratelimit.decorators import ratelimit
......@@ -182,6 +183,8 @@ def create_account_with_params(request, params):
]}
)
if is_third_party_auth_enabled:
set_custom_attribute('register_user_tpa', pipeline.running(request))
extended_profile_fields = configuration_helpers.get_value('extended_profile_fields', [])
# Can't have terms of service for certain SHIB users, like at Stanford
registration_fields = getattr(settings, 'REGISTRATION_EXTRA_FIELDS', {})
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment