From 3f22696b41e6e2d0a9eaf6cf16d06e1f3a4a5566 Mon Sep 17 00:00:00 2001 From: Iain Learmonth Date: Sat, 14 May 2022 14:46:40 +0100 Subject: [PATCH] portal: count bridges on home card --- app/portal/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/portal/__init__.py b/app/portal/__init__.py index 6687966..94d0fc1 100644 --- a/app/portal/__init__.py +++ b/app/portal/__init__.py @@ -71,6 +71,7 @@ def portal_home(): s: len(Alarm.query.filter(Alarm.alarm_state == s.upper(), Alarm.last_updated > (now - timedelta(days=1))).all()) for s in ["critical", "warning", "ok", "unknown"] } + bridges = Bridge.query.filter(Bridge.destroyed == None).all() br_last = { d: len(Bridge.query.filter(Bridge.deprecated > (now - timedelta(days=d))).all()) for d in [1, 3, 7]