@treeio_login_required
@handle_response_format
def chart_delete(request, chart_id, response_format='html'):
 chart = get_object_or_404(Chart, pk=chart_id)
 report = chart.report
 if (not request.user.profile.has_permission(chart, mode='w')):
  return user_denied(request, message="You don't have access to this Event")
 if request.POST:
  if ('delete' in request.POST):
   if ('trash' in request.POST):
    chart.trash = True
    chart.save()
   else:
    chart.delete()
   return HttpResponseRedirect(reverse('reports_report_view', args=[report.id]))
  elif ('cancel' in request.POST):
   return HttpResponseRedirect(reverse('reports_report_view', args=[report.id]))
 return render_to_response('reports/chart_delete', {'chart': chart}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required @ handle_response_format def chart_delete ( request , chart_id , response_format = 'html' ) : chart = get_object_or_404 ( Chart , pk = chart_id ) report = chart . report if ( not request . user . profile . has_permission ( chart , mode = 'w' ) ) : return user_denied ( request , message = "You don't have access to this Event" ) if request . POST : if ( 'delete' in request . POST ) : if ( 'trash' in request . POST ) : chart . trash = True chart . save ( ) else : chart . delete ( ) return HttpResponseRedirect ( reverse ( 'reports_report_view' , args = [ report . id ] ) ) elif ( 'cancel' in request . POST ) : return HttpResponseRedirect ( reverse ( 'reports_report_view' , args = [ report . id ] ) ) return render_to_response ( 'reports/chart_delete' , { 'chart' : chart } , context_instance = RequestContext ( request ) , response_format = response_format )
chart delete .