Commit 6871bfd3 authored by jan-pieter's avatar jan-pieter

fixed that when the person isn't in the queue the site doesn't crash

parent f798a27a
......@@ -44,11 +44,13 @@ def home():
@app.route("/statusUpdate", methods=["POST", "GET"])
def statusUpdate():
if people and request.method == "POST":
index = people.index(Person(request.form["name"]))
print(index)
people[index].status += 1
if people[index].status == 3:
people.remove(people[index])
newPerson = Person(request.form["name"])
if newPerson in people:
index = people.index(newPerson)
print(index)
people[index].status += 1
if people[index].status == 3:
people.remove(people[index])
return redirect("/")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment