Filters non working servers in quick booking 48/72148/1
authorSean Smith <ssmith@iol.unh.edu>
Mon, 8 Mar 2021 22:15:42 +0000 (17:15 -0500)
committerSean Smith <ssmith@iol.unh.edu>
Mon, 8 Mar 2021 22:15:42 +0000 (17:15 -0500)
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: I47776a3e239a333d544d9e6e86f702b1d299baeb

src/account/models.py

index 40de4d8..2a7b017 100644 (file)
@@ -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):