Skip to content
Snippets Groups Projects
Unverified Commit 5e2bbd88 authored by Dillon Dumesnil's avatar Dillon Dumesnil Committed by GitHub
Browse files

Merge pull request #26763 from edx/ddumesnil/segment-logout-aa-513

AA-513: Add segment event for logout
parents a90453b0 82d33679
No related branches found
No related tags found
No related merge requests found
......@@ -2555,9 +2555,13 @@ def log_successful_logout(sender, request, user, **kwargs): # lint-amnesty, pyl
"""Handler to log when logouts have occurred successfully."""
if hasattr(request, 'user'):
if settings.FEATURES['SQUELCH_PII_IN_LOGS']:
AUDIT_LOG.info(u"Logout - user.id: {0}".format(request.user.id)) # pylint: disable=logging-format-interpolation
AUDIT_LOG.info('Logout - user.id: {0}'.format(request.user.id)) # pylint: disable=logging-format-interpolation
else:
AUDIT_LOG.info(u"Logout - {0}".format(request.user)) # pylint: disable=logging-format-interpolation
AUDIT_LOG.info('Logout - {0}'.format(request.user)) # pylint: disable=logging-format-interpolation
tracker.emit('edx.bi.user.account.logout', {
'referrer': request.META.get('HTTP_REFERER'),
'user_id': request.user.id,
})
@receiver(user_logged_in)
......
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