From c8dead4457f9de3b6c6bb7fece1b6b18a1420382 Mon Sep 17 00:00:00 2001 From: "R. Miles McCain" Date: Fri, 28 Aug 2020 17:19:07 +0000 Subject: [PATCH] Prevent services from showing up twice on homepage --- shynet/dashboard/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shynet/dashboard/views.py b/shynet/dashboard/views.py index 7193f85..b1f00e2 100644 --- a/shynet/dashboard/views.py +++ b/shynet/dashboard/views.py @@ -29,7 +29,7 @@ class DashboardView(LoginRequiredMixin, DateRangeMixin, TemplateView): data = super().get_context_data(**kwargs) data["services"] = Service.objects.filter( Q(owner=self.request.user) | Q(collaborators__in=[self.request.user]) - ) + ).distinct() for service in data["services"]: service.stats = service.get_core_stats(data["start_date"], data["end_date"]) return data