From 0deab28320f65e4c4518be701b2a6b9817088d02 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 9 Mar 2023 18:55:39 +0000 Subject: [PATCH] Add bank fetch to balances page --- core/views/banks.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/views/banks.py b/core/views/banks.py index 331d2bf..ed3ca86 100644 --- a/core/views/banks.py +++ b/core/views/banks.py @@ -66,6 +66,19 @@ class BanksBalances(LoginRequiredMixin, OTPRequiredMixin, ObjectList): list_url_name = "balances" list_url_args = ["type"] + def get_context_data(self): + context = super().get_context_data() + self.extra_buttons = [ + { + "url": reverse("bank_fetch"), + "action": "refresh", + "method": "get", + "label": "Fetch account details", + "icon": "fa-solid fa-refresh", + }, + ] + return context + def get_queryset(self, **kwargs): aggregators = Aggregator.objects.filter(user=self.request.user, enabled=True) account_balances = {}