@handle_response_format
@treeio_login_required
def user_password(request, user_id, response_format='html'):
 profile = get_object_or_404(User, pk=user_id)
 if request.POST:
  if ('cancel' not in request.POST):
   form = PasswordForm(profile.user, request.POST)
   if form.is_valid():
    form.save()
    return HttpResponseRedirect(reverse('core_admin_user_view', args=[profile.id]))
  else:
   return HttpResponseRedirect(reverse('core_admin_user_view', args=[profile.id]))
 else:
  form = PasswordForm(profile.user)
 return render_to_response('core/administration/user_password', {'profile': profile, 'form': form}, context_instance=RequestContext(request), response_format=response_format)

@ handle_response_format @ treeio_login_required def user_password ( request , user_id , response_format = 'html' ) : profile = get_object_or_404 ( User , pk = user_id ) if request . POST : if ( 'cancel' not in request . POST ) : form = PasswordForm ( profile . user , request . POST ) if form . is_valid ( ) : form . save ( ) return HttpResponseRedirect ( reverse ( 'core_admin_user_view' , args = [ profile . id ] ) ) else : return HttpResponseRedirect ( reverse ( 'core_admin_user_view' , args = [ profile . id ] ) ) else : form = PasswordForm ( profile . user ) return render_to_response ( 'core/administration/user_password' , { 'profile' : profile , 'form' : form } , context_instance = RequestContext ( request ) , response_format = response_format )
user change password form .