rename token to card (eventlog)
not renaming inventory items, as they need migration refactor eventlog format, harmonized with inventory-app
This commit is contained in:
@@ -150,7 +150,7 @@ async def view_longpoll(request):
|
||||
ev = event["fullDocument"]
|
||||
if ev["approved"] != "true":
|
||||
continue
|
||||
if ev["type"] == "token":
|
||||
if ev["type"] == "card":
|
||||
continue
|
||||
|
||||
response.send("data: %s\n\n" % ev["door"])
|
||||
@@ -203,18 +203,17 @@ async def swipe(request):
|
||||
|
||||
event_swipe = {
|
||||
"component": "doorboy",
|
||||
"method": "token",
|
||||
"method": "card",
|
||||
"timestamp": timestamp,
|
||||
"door": data["door"],
|
||||
"event": "card-swiped",
|
||||
"approved": data["approved"],
|
||||
"uid_hash": data["uid_hash"],
|
||||
"user": {
|
||||
"id": token.get("inventory", {}).get("owner", {}).get("username", ""),
|
||||
"name": token.get("inventory", {})
|
||||
.get("owner", {})
|
||||
.get("display_name", "Unclaimed Token"),
|
||||
},
|
||||
"uid_hash": data["uid_hash"],
|
||||
}
|
||||
await app.ctx.db.eventlog.insert_one(event_swipe)
|
||||
|
||||
|
Reference in New Issue
Block a user