From 13faabf01f4bf005eeee142a24d6737b45632ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madis=20M=C3=A4gi?= Date: Fri, 11 Aug 2023 18:20:01 +0300 Subject: [PATCH] Add approval checking --- app/doorboy-proxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/doorboy-proxy.py b/app/doorboy-proxy.py index f848fdb..1182a93 100755 --- a/app/doorboy-proxy.py +++ b/app/doorboy-proxy.py @@ -76,7 +76,7 @@ async def view_longpoll(request): async with app.ctx.db.eventlog.watch(pipeline) as stream: await response.send("data: watch-stream-opened\n\n") async for event in stream: - if event["fullDocument"].get("type") == "open-door": + if event["fullDocument"].get("type") == "open-door" and event["fullDocument"].get("approved", False): await response.send("data: %s\n\n" % event["fullDocument"]["door"]) except pymongo.errors.PyMongoError as e: