From 63fd53f42accd225fc689aa1d1baa325796f7b4e Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Mon, 10 Feb 2020 00:39:57 +0000 Subject: [PATCH] Exclude blank report types as well --- apiserver/apiserver/api/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apiserver/apiserver/api/views.py b/apiserver/apiserver/api/views.py index 147ee86..c366161 100644 --- a/apiserver/apiserver/api/views.py +++ b/apiserver/apiserver/api/views.py @@ -226,7 +226,9 @@ class TransactionViewSet(Base, List, Create, Retrieve, Update): def get_queryset(self): queryset = models.Transaction.objects if self.action == 'list': - return queryset.exclude(report_type__isnull=True).order_by('-id', '-date') + queryset = queryset.exclude(report_type__isnull=True) + queryset = queryset.exclude(report_type='') + return queryset.order_by('-id', '-date') else: return queryset.all()