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)
|
||||
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):
|
||||
|
|
Loading…
Reference in a new issue