@handle_response_format
@treeio_login_required
@module_admin_required()
def user_edit(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 = UserForm(request.POST, instance=profile)
   if form.is_valid():
    profile = 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 = UserForm(instance=profile)
 return render_to_response('core/administration/user_edit', {'profile': profile, 'form': form}, context_instance=RequestContext(request), response_format=response_format)

@ handle_response_format @ treeio_login_required @ module_admin_required ( ) def user_edit ( 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 = UserForm ( request . POST , instance = profile ) if form . is_valid ( ) : profile = 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 = UserForm ( instance = profile ) return render_to_response ( 'core/administration/user_edit' , { 'profile' : profile , 'form' : form } , context_instance = RequestContext ( request ) , response_format = response_format )
user edit .