From 387fa56442215a5e4a9fa96be1529c43d62015a4 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Thu, 29 Jun 2023 12:32:48 +0100 Subject: [PATCH] Exclude non-rigs from the 'now' checkin list --- PyRIGS/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyRIGS/views.py b/PyRIGS/views.py index 537e01b9..f02da3d2 100644 --- a/PyRIGS/views.py +++ b/PyRIGS/views.py @@ -48,7 +48,7 @@ class Index(generic.TemplateView): # Displays the current rig count along with def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['rig_count'] = models.Event.objects.rig_count() - context['now'] = models.Event.objects.events_in_bounds(timezone.now(), timezone.now()).exclude(dry_hire=True).exclude(status=models.Event.CANCELLED) + context['now'] = models.Event.objects.events_in_bounds(timezone.now(), timezone.now()).exclude(status=models.Event.CANCELLED).filter(is_rig=True, dry_hire=False) return context