@require_GET
def confirm_change_email(request, activation_key):
    activation_key = activation_key.lower()
    email_change = get_object_or_404(EmailChange,
                                     activation_key=activation_key)
    u = email_change.user
    old_email = u.email

    # Check that this new email isn't a duplicate in the system.
    new_email = email_change.email
    duplicate = User.objects.filter(email=new_email).exists()
    if not duplicate:
        # Update user's email.
        u.email = new_email
        u.save()

    # Delete the activation profile now, we don't need it anymore.
    email_change.delete()

    return render(request, 'users/change_email_complete.html', {
        'old_email': old_email, 'new_email': new_email,
        'username': u.username, 'duplicate': duplicate})
Confirm the new email for the user.
dataset/ETHPy150Open mozilla/kitsune/kitsune/users/views.py/confirm_change_email