From 3372c744f399980c97cc1c1bd30102c389ecf157 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 3 Aug 2023 16:58:17 +0200 Subject: ✨ Imports groups - form: filter add button by availability - importer file is required MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ishtar_common/views.py') diff --git a/ishtar_common/views.py b/ishtar_common/views.py index b58ab024a..31d3d9516 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -1598,7 +1598,12 @@ class ImportListView(IshtarMixin, LoginRequiredMixin, ListView): def get_context_data(self, **kwargs): dct = super(ImportListView, self).get_context_data(**kwargs) - dct["autorefresh_available"] = settings.USE_BACKGROUND_TASK + dct.update({ + "autorefresh_available": settings.USE_BACKGROUND_TASK, + "has_import_table": models.ImporterType.objects.filter(available=True, is_import=True, type='tab').count(), + "has_import_gis": models.ImporterType.objects.filter(available=True, is_import=True, type='gis').count(), + "has_import_group": models.ImporterGroup.objects.filter(available=True).count(), + }) return dct -- cgit v1.2.3