Commit 87aa4ae9 authored by Daniele Venzano's avatar Daniele Venzano

Fix bug that prevents accessing the web interface when there is an application in submitted status

parent 8ca74616
......@@ -101,7 +101,7 @@ class HomeWeb(ZoeWebRequestHandler):
}
last_running_executions += self.api_endpoint.execution_list(self.current_user, **filters)
running_reservations = [e.total_reservations for e in last_running_executions]
running_reservations = [e.total_reservations for e in last_running_executions if e.total_reservations is not None]
total_memory = sum([r.memory.min for r in running_reservations])
total_cores = sum([r.cores.min for r in running_reservations])
......
......@@ -216,7 +216,7 @@ class Execution(BaseRecord):
def total_reservations(self):
"""Return the union/sum of resources reserved by all services of this execution."""
if len(self.services) == 0:
return 0
return None
return functools.reduce(lambda x, y: x + y, [s.resource_reservation for s in self.services])
@property
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment