From e934e7b1a21ce36d6126a5021f6fd3887c3e9bef Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sat, 6 May 2023 11:59:30 +0100 Subject: [PATCH] Allow deleting requisitions --- app/urls.py | 5 +++++ core/templates/partials/linkgroup-info.html | 17 +++++++++++++++++ core/views/banks.py | 6 +++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/app/urls.py b/app/urls.py index 87b6147..771306a 100644 --- a/app/urls.py +++ b/app/urls.py @@ -126,6 +126,11 @@ urlpatterns = [ banks.BanksRequisitionUpdate.as_view(), name="requisition_update", ), + path( + "banks//req_delete//", + banks.BanksRequisitionDelete.as_view(), + name="requisition_delete", + ), # Bank balances path( "banks//balances/", diff --git a/core/templates/partials/linkgroup-info.html b/core/templates/partials/linkgroup-info.html index e39ce99..88c925d 100644 --- a/core/templates/partials/linkgroup-info.html +++ b/core/templates/partials/linkgroup-info.html @@ -14,6 +14,7 @@ aggregator payees throughput + actions {% for item in requisitions %} @@ -25,6 +26,22 @@ {% endfor %} {{ item.throughput }} + + + {% endfor %} diff --git a/core/views/banks.py b/core/views/banks.py index 123b2bf..e01a7b0 100644 --- a/core/views/banks.py +++ b/core/views/banks.py @@ -1,7 +1,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin from django.http import HttpResponse from django.urls import reverse -from mixins.views import ObjectList, ObjectUpdate +from mixins.views import ObjectDelete, ObjectList, ObjectUpdate from rest_framework import status from two_factor.views.mixins import OTPRequiredMixin @@ -45,6 +45,10 @@ class BanksRequisitionUpdate(LoginRequiredMixin, OTPRequiredMixin, ObjectUpdate) return req +class BanksRequisitionDelete(LoginRequiredMixin, OTPRequiredMixin, ObjectDelete): + model = Requisition + + class BanksCurrencies(LoginRequiredMixin, OTPRequiredMixin, ObjectList): """ Get a list of bank accounts with their details.