Crash de la vue pour changer de mot de passe #32

Open
mpepin wants to merge 3 commits from kerl/change_pwd into master
Showing only changes of commit 7c281f926b - Show all commits

View file

@ -63,22 +63,20 @@ def change_membre(request):
user_form = ChangeFormUser(instance=request.user)
return render(request, 'gestion/change.html', locals())
@login_required
def change_password(request):
success = False
if request.method == 'POST':
requbis = request.POST.copy()
form = PasswordChangeForm(request.user, data=requbis)
form = PasswordChangeForm(request.user, data=request.POST)
if form.is_valid():
request.user.profile.photo.delete()
form.save()
success = True
else:
form = PasswordChangeForm(request.user)
return render(request, 'gestion/changepasswd.html', locals())
return render(
request, 'gestion/changepasswd.html', {"form": form, "success": success}
)
def inscription_membre(request):