Exemplo n.º 1
0
def password_change(request, template):
    """Change password form page."""
    if request.method == "POST":
        form = PasswordChangeForm(user=request.user, data=request.POST)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse("users.pw_change_complete"))
    else:
        form = PasswordChangeForm(user=request.user)
    return render(request, template, {"form": form})
Exemplo n.º 2
0
def password_change(request, template):
    """Change password form page."""
    if request.method == 'POST':
        form = PasswordChangeForm(user=request.user, data=request.POST)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('users.pw_change_complete'))
    else:
        form = PasswordChangeForm(user=request.user)
    return render(request, template, {'form': form})
Exemplo n.º 3
0
def password_change(request):
    """Change password form page."""
    if request.user.profile.is_fxa_migrated:
        raise Http404
    if request.method == 'POST':
        form = PasswordChangeForm(user=request.user, data=request.POST)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect(reverse('users.pw_change_complete'))
    else:
        form = PasswordChangeForm(user=request.user)
    return render(request, 'users/pw_change.html', {'form': form})