@handle_response_format
@treeio_login_required
def service_record_delete(request, service_record_id, response_format='html'):
 service_record = get_object_or_404(ItemServicing, pk=service_record_id)
 if (not request.user.profile.has_permission(service_record, mode='w')):
  return user_denied(request, message="You don't have write access to this ServiceRecord")
 if request.POST:
  if ('delete' in request.POST):
   if ('trash' in request.POST):
    service_record.trash = True
    service_record.save()
   else:
    service_record.delete()
   return HttpResponseRedirect(reverse('infrastructure_settings_view'))
  elif ('cancel' in request.POST):
   return HttpResponseRedirect(reverse('infrastructure_service_record_view', args=[service_record.id]))
 context = _get_default_context(request)
 context.update({'service_record': service_record})
 return render_to_response('infrastructure/service_record_delete', context, context_instance=RequestContext(request), response_format=response_format)

@ handle_response_format @ treeio_login_required def service_record_delete ( request , service_record_id , response_format = 'html' ) : service_record = get_object_or_404 ( ItemServicing , pk = service_record_id ) if ( not request . user . profile . has_permission ( service_record , mode = 'w' ) ) : return user_denied ( request , message = "You don't have write access to this ServiceRecord" ) if request . POST : if ( 'delete' in request . POST ) : if ( 'trash' in request . POST ) : service_record . trash = True service_record . save ( ) else : service_record . delete ( ) return HttpResponseRedirect ( reverse ( 'infrastructure_settings_view' ) ) elif ( 'cancel' in request . POST ) : return HttpResponseRedirect ( reverse ( 'infrastructure_service_record_view' , args = [ service_record . id ] ) ) context = _get_default_context ( request ) context . update ( { 'service_record' : service_record } ) return render_to_response ( 'infrastructure/service_record_delete' , context , context_instance = RequestContext ( request ) , response_format = response_format )
servicerecord delete page .