From 85598208ad7b65de9e4c60b509331a9b6ce46e52 Mon Sep 17 00:00:00 2001 From: Sean Smith Date: Mon, 8 Mar 2021 17:15:42 -0500 Subject: [PATCH] Filters non working servers in quick booking Signed-off-by: Sean Smith Change-Id: I47776a3e239a333d544d9e6e86f702b1d299baeb --- src/account/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/account/models.py b/src/account/models.py index 40de4d8..2a7b017 100644 --- a/src/account/models.py +++ b/src/account/models.py @@ -237,7 +237,7 @@ class Lab(models.Model): def get_available_resources(self): # Cannot import model normally due to ciruclar import Server = apps.get_model('resource_inventory', 'Server') # TODO: Find way to import ResourceQuery - resources = [str(resource.profile) for resource in Server.objects.filter(lab=self, booked=False)] + resources = [str(resource.profile) for resource in Server.objects.filter(lab=self, working=True, booked=False)] return dict(Counter(resources)) def __str__(self): -- 2.16.6