Update door names
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful

This commit is contained in:
Madis Mägi 2023-08-10 20:59:15 +03:00
parent f53d670189
commit 550136713b
2 changed files with 3 additions and 3 deletions

View File

@ -69,7 +69,7 @@ def view_slack_doorboy():
return "Invalid channel was supplied"
command = request.form.get("command")
try:
door = {"/open-new-door": "back", "/open-back-door": "back", "/open-front-door": "front", "/open-ground-door": "ground"}[command]
door = {"/open-new-door": "backdoor", "/open-back-door": "backdoor", "/open-front-door": "frontdoor", "/open-ground-door": "grounddoor"}[command]
except KeyError:
return "Invalid command was supplied"

View File

@ -117,7 +117,7 @@ def save_doorboy_edit(token_id):
return redirect("/m/doorboy")
class HoldDoorForm(FlaskForm):
door_name = SelectField("Door name", choices=[(j,j) for j in ["ground", "front", "back"]], validators=[DataRequired()])
door_name = SelectField("Door name", choices=[(j,j) for j in ["grounddoor", "frontdoor", "backdoor"]], validators=[DataRequired()])
duration = IntegerField('Duration in seconds', validators=[DataRequired(), validators.NumberRange(min=5, max=21600)])
@page_doorboy.route("/m/doorboy/hold", methods=["POST"])
@ -141,7 +141,7 @@ def view_doorboy_hold():
@login_required
def view_doorboy_open(door):
user = read_user()
if door not in ("ground", "front", "back"): raise
if door not in ("grounddoor", "frontdoor", "backdoor"): raise
approved = user["username"] in users_lookup
db.eventlog.insert_one({
"method": "web",