@treeio_login_required
@handle_response_format
def opportunity_view(request, opportunity_id, response_format='html'):
 profile = request.user.profile
 opportunity = get_object_or_404(Opportunity, pk=opportunity_id)
 if ((not profile.has_permission(opportunity)) and (not profile.is_admin('treeio.sales'))):
  return user_denied(request, message="You don't have access to this Opportunity")
 form = _do_update_record(profile, request, opportunity)
 return render_to_response('sales/opportunity_view', {'opportunity': opportunity, 'record_form': form}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required @ handle_response_format def opportunity_view ( request , opportunity_id , response_format = 'html' ) : profile = request . user . profile opportunity = get_object_or_404 ( Opportunity , pk = opportunity_id ) if ( ( not profile . has_permission ( opportunity ) ) and ( not profile . is_admin ( 'treeio.sales' ) ) ) : return user_denied ( request , message = "You don't have access to this Opportunity" ) form = _do_update_record ( profile , request , opportunity ) return render_to_response ( 'sales/opportunity_view' , { 'opportunity' : opportunity , 'record_form' : form } , context_instance = RequestContext ( request ) , response_format = response_format )
opportunity view .