@treeio_login_required
@handle_response_format
def asset_delete(request, asset_id, response_format='html'):
 asset = get_object_or_404(Asset, pk=asset_id)
 if (not request.user.profile.has_permission(asset, mode='w')):
  return user_denied(request, "You don't have access to this Asset", response_format)
 if request.POST:
  if ('delete' in request.POST):
   if ('trash' in request.POST):
    asset.trash = True
    asset.save()
   else:
    asset.delete()
   return HttpResponseRedirect(reverse('finance_index_assets'))
  elif ('cancel' in request.POST):
   return HttpResponseRedirect(reverse('finance_asset_view', args=[asset.id]))
 return render_to_response('finance/asset_delete', {'asset': asset}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required @ handle_response_format def asset_delete ( request , asset_id , response_format = 'html' ) : asset = get_object_or_404 ( Asset , pk = asset_id ) if ( not request . user . profile . has_permission ( asset , mode = 'w' ) ) : return user_denied ( request , "You don't have access to this Asset" , response_format ) if request . POST : if ( 'delete' in request . POST ) : if ( 'trash' in request . POST ) : asset . trash = True asset . save ( ) else : asset . delete ( ) return HttpResponseRedirect ( reverse ( 'finance_index_assets' ) ) elif ( 'cancel' in request . POST ) : return HttpResponseRedirect ( reverse ( 'finance_asset_view' , args = [ asset . id ] ) ) return render_to_response ( 'finance/asset_delete' , { 'asset' : asset } , context_instance = RequestContext ( request ) , response_format = response_format )
asset delete .