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

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