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

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