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

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