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) user_form = ChangeFormUser(instance=request.user)
return render(request, 'gestion/change.html', locals()) return render(request, 'gestion/change.html', locals())
@login_required @login_required
def change_password(request): def change_password(request):
success = False
if request.method == 'POST': if request.method == 'POST':
requbis = request.POST.copy() form = PasswordChangeForm(request.user, data=request.POST)
form = PasswordChangeForm(request.user, data=requbis)
if form.is_valid(): if form.is_valid():
request.user.profile.photo.delete()
form.save() form.save()
success = True success = True
else: else:
form = PasswordChangeForm(request.user) 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): def inscription_membre(request):