@treeio_login_required
@handle_response_format
def report_delete(request, report_id, response_format='html'):
 report = get_object_or_404(Report, pk=report_id)
 if (not request.user.profile.has_permission(report, 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):
    report.trash = True
    report.save()
   else:
    report.delete()
   return HttpResponseRedirect(reverse('reports_index'))
  elif ('cancel' in request.POST):
   return HttpResponseRedirect(reverse('reports_report_view', args=[report.id]))
 return render_to_response('reports/report_delete', {'report': report}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required @ handle_response_format def report_delete ( request , report_id , response_format = 'html' ) : report = get_object_or_404 ( Report , pk = report_id ) if ( not request . user . profile . has_permission ( report , 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 ) : report . trash = True report . save ( ) else : report . delete ( ) return HttpResponseRedirect ( reverse ( 'reports_index' ) ) elif ( 'cancel' in request . POST ) : return HttpResponseRedirect ( reverse ( 'reports_report_view' , args = [ report . id ] ) ) return render_to_response ( 'reports/report_delete' , { 'report' : report } , context_instance = RequestContext ( request ) , response_format = response_format )
report delete .