half-typing is not my passion
This commit is contained in:
@@ -150,11 +150,12 @@ async def view_longpoll(request):
|
||||
await response.send("data: watch-stream-opened\n\n")
|
||||
async for event in stream:
|
||||
ev = event["fullDocument"]
|
||||
if ev["approved"] != "true":
|
||||
if not ev["approved"]:
|
||||
continue
|
||||
if ev["type"] == "card":
|
||||
if ev["method"] == "card":
|
||||
continue
|
||||
|
||||
|
||||
print("realtime opening %s" % ev["door"])
|
||||
response.send("data: %s\n\n" % ev["door"])
|
||||
except PyMongoError as e:
|
||||
print(e)
|
||||
|
||||
@@ -7,6 +7,7 @@ import requests
|
||||
from pymongo.errors import PyMongoError
|
||||
from requests.exceptions import RequestException
|
||||
from sanic import Blueprint
|
||||
from sanic.response import text
|
||||
|
||||
slack_app = Blueprint("slack", __name__)
|
||||
|
||||
@@ -133,4 +134,4 @@ async def slack_open(request):
|
||||
}
|
||||
)
|
||||
|
||||
return f"Opening {door}…"
|
||||
return text(f"Opening {door}…")
|
||||
|
||||
Reference in New Issue
Block a user