@never_cache
@anonymous_csrf
def password_reset_confirm(request, uidb64=None, token=None):
    """
    Pulled from django contrib so that we can add user into the form
    so then we can show relevant messages about the user.
    """
    assert uidb64 is not None and token is not None
    user = None
    try:
        uid_int = urlsafe_base64_decode(uidb64)
        user = UserProfile.objects.get(id=uid_int)
    except (__HOLE__, UserProfile.DoesNotExist, TypeError):
        pass

    if (user is not None and user.fxa_migrated()
            and waffle.switch_is_active('fxa-auth')):
        migrated = True
        validlink = False
        form = None
    elif user is not None and default_token_generator.check_token(user, token):
        migrated = False
        validlink = True
        if request.method == 'POST':
            form = forms.SetPasswordForm(user, request.POST)
            if form.is_valid():
                form.save()
                log_cef('Password Changed', 5, request,
                        username=user.username,
                        signature='PASSWORDCHANGED',
                        msg='User changed password')
                return redirect(reverse('django.contrib.auth.'
                                        'views.password_reset_complete'))
        else:
            form = forms.SetPasswordForm(user)
    else:
        migrated = False
        validlink = False
        form = None

    return render(request, 'users/pwreset_confirm.html',
                  {'form': form, 'validlink': validlink, 'migrated': migrated})
dataset/ETHPy150Open mozilla/addons-server/src/olympia/users/views.py/password_reset_confirm