From: Sean Smith Date: Mon, 8 Mar 2021 22:15:42 +0000 (-0500) Subject: Filters non working servers in quick booking X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=8559820;p=laas.git Filters non working servers in quick booking Signed-off-by: Sean Smith Change-Id: I47776a3e239a333d544d9e6e86f702b1d299baeb --- 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):