add /open-all-doors
This commit is contained in:
parent
2134512805
commit
cdfe6373e1
@ -71,7 +71,7 @@ def view_slack_doorboy():
|
|||||||
command = request.form.get("command")
|
command = request.form.get("command")
|
||||||
try:
|
try:
|
||||||
door = {
|
door = {
|
||||||
"/open-new-door": "backdoor",
|
"/open-all-doors": "outsidedoors",
|
||||||
"/open-back-door": "backdoor",
|
"/open-back-door": "backdoor",
|
||||||
"/open-front-door": "frontdoor",
|
"/open-front-door": "frontdoor",
|
||||||
"/open-ground-door": "grounddoor",
|
"/open-ground-door": "grounddoor",
|
||||||
@ -91,17 +91,23 @@ def view_slack_doorboy():
|
|||||||
else:
|
else:
|
||||||
access_group = "k-space:floor"
|
access_group = "k-space:floor"
|
||||||
approved = access_group in member.groups
|
approved = access_group in member.groups
|
||||||
db.eventlog.insert_one({
|
|
||||||
"method": "slack",
|
doors = [door]
|
||||||
"approved": approved,
|
if door == "outsidedoors":
|
||||||
"duration": 5,
|
doors = ["backdoor", "frontdoor", "grounddoor"]
|
||||||
"component": "doorboy",
|
|
||||||
"type": "open-door",
|
for door in doors:
|
||||||
"door": door,
|
db.eventlog.insert_one({
|
||||||
"member_id": member.username,
|
"method": "slack",
|
||||||
"member": member.display_name,
|
"approved": approved,
|
||||||
"timestamp": datetime.utcnow(),
|
"duration": 5,
|
||||||
})
|
"component": "doorboy",
|
||||||
|
"type": "open-door",
|
||||||
|
"door": door,
|
||||||
|
"member_id": member.username,
|
||||||
|
"member": member.display_name,
|
||||||
|
"timestamp": datetime.utcnow(),
|
||||||
|
})
|
||||||
|
|
||||||
status = "Permitted" if approved else "Denied"
|
status = "Permitted" if approved else "Denied"
|
||||||
subject = member.display_name
|
subject = member.display_name
|
||||||
|
Loading…
Reference in New Issue
Block a user