@treeio_login_required
@handle_response_format
def lead_view(request, lead_id, response_format='html'):
 profile = request.user.profile
 lead = get_object_or_404(Lead, pk=lead_id)
 if ((not profile.has_permission(lead)) and (not profile.is_admin('treeio.sales'))):
  return user_denied(request, message="You don't have access to this Lead")
 form = _do_update_record(profile, request, lead)
 if form.is_valid():
  record = form.save()
  record.set_user_from_request(request)
  lead = record.object
 return render_to_response('sales/lead_view', {'lead': lead, 'form': form}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required @ handle_response_format def lead_view ( request , lead_id , response_format = 'html' ) : profile = request . user . profile lead = get_object_or_404 ( Lead , pk = lead_id ) if ( ( not profile . has_permission ( lead ) ) and ( not profile . is_admin ( 'treeio.sales' ) ) ) : return user_denied ( request , message = "You don't have access to this Lead" ) form = _do_update_record ( profile , request , lead ) if form . is_valid ( ) : record = form . save ( ) record . set_user_from_request ( request ) lead = record . object return render_to_response ( 'sales/lead_view' , { 'lead' : lead , 'form' : form } , context_instance = RequestContext ( request ) , response_format = response_format )
queue view .