summaryrefslogtreecommitdiff
path: root/ishtar_common/views.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-08-03 16:58:17 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2024-02-05 10:51:51 +0100
commit90b955b97ac90fad27b00e0b702d3ab344abaced (patch)
tree508b8b9871081811584dfb6748e8bab06a083d5d /ishtar_common/views.py
parent30e04c4bb8b2359ade60979a6e365b87d696bd40 (diff)
downloadIshtar-90b955b97ac90fad27b00e0b702d3ab344abaced.tar.bz2
Ishtar-90b955b97ac90fad27b00e0b702d3ab344abaced.zip
✨ Imports groups - form: filter add button by availability - importer file is required
Diffstat (limited to 'ishtar_common/views.py')
-rw-r--r--ishtar_common/views.py7
1 files changed, 6 insertions, 1 deletions
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