Added a tracking event for when the user switches their secondary email to their primary.
This commit is contained in:
@@ -912,11 +912,20 @@ def password_reset_confirm_wrapper(request, uidb36=None, token=None):
|
||||
|
||||
# get the updated user
|
||||
updated_user = User.objects.get(id=uid_int)
|
||||
|
||||
if 'is_account_recovery' in request.GET:
|
||||
try:
|
||||
updated_user.email = updated_user.account_recovery.secondary_email
|
||||
updated_user.account_recovery.delete()
|
||||
# emit an event that the user changed their secondary email to the primary email
|
||||
tracker.emit(
|
||||
SETTING_CHANGE_INITIATED,
|
||||
{
|
||||
"setting": "email",
|
||||
"old": user.email,
|
||||
"new": updated_user.email,
|
||||
"user_id": updated_user.id,
|
||||
}
|
||||
)
|
||||
except ObjectDoesNotExist:
|
||||
log.error(
|
||||
'Account recovery process initiated without AccountRecovery instance for user {username}'.format(
|
||||
|
||||
Reference in New Issue
Block a user