def password_change(request): person = request.user.get_profile() if request.POST: form = PasswordChangeForm(request.POST) if form.is_valid(): form.save(person) return HttpResponseRedirect(reverse('kg_user_password_done')) else: form = PasswordChangeForm() return render_to_response('people/user_password_form.html', {'form': form}, context_instance=RequestContext(request))
def personal_details(request): if request.POST: form = PasswordChangeForm(request.POST) if form.is_valid(): form.save(request.user) messages.success(request, "Password changed successfully") return HttpResponseRedirect(reverse('kg_user_profile')) else: form = PasswordChangeForm() return render_to_response('people/profile.html', {'form': form}, context_instance=RequestContext(request))
def password_change(request): person = request.user if request.POST: form = PasswordChangeForm(data=request.POST, person=person) if form.is_valid(): form.save() messages.success(request, "Password changed successfully") return HttpResponseRedirect(reverse('kg_profile')) else: form = PasswordChangeForm(person=person) return render( template_name='karaage/common/profile_password.html', context={'person': person, 'form': form}, request=request)
def password_change(request): person = request.user if request.POST: form = PasswordChangeForm(data=request.POST, person=person) if form.is_valid(): form.save() messages.success(request, "Password changed successfully") return HttpResponseRedirect(reverse('kg_profile')) else: form = PasswordChangeForm(person=person) return render_to_response( 'common/profile_password.html', {'person': person, 'form': form}, context_instance=RequestContext(request))