Crash de la vue pour changer de mot de passe #32
1 changed files with 6 additions and 8 deletions
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue