Skip to content
Snippets Groups Projects
Unverified Commit aeb71250 authored by Dillon Dumesnil's avatar Dillon Dumesnil
Browse files

AA-513: Ensure user id exists before trying to send event

request.user.id could be None which ends up raising an error in
the analytics package we use.
parent 53d9f662
No related branches found
No related tags found
No related merge requests found
......@@ -2558,7 +2558,8 @@ def log_successful_logout(sender, request, user, **kwargs): # lint-amnesty, pyl
AUDIT_LOG.info('Logout - user.id: {0}'.format(request.user.id)) # pylint: disable=logging-format-interpolation
else:
AUDIT_LOG.info('Logout - {0}'.format(request.user)) # pylint: disable=logging-format-interpolation
segment.track(request.user.id, 'edx.bi.user.account.logout')
if request.user.id:
segment.track(request.user.id, 'edx.bi.user.account.logout')
@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