fixed that when the person isn't in the queue the site doesn't crash
This commit is contained in:
parent
f798a27a90
commit
6871bfd3bf
1 changed files with 7 additions and 5 deletions
12
main.py
12
main.py
|
@ -44,11 +44,13 @@ def home():
|
||||||
@app.route("/statusUpdate", methods=["POST", "GET"])
|
@app.route("/statusUpdate", methods=["POST", "GET"])
|
||||||
def statusUpdate():
|
def statusUpdate():
|
||||||
if people and request.method == "POST":
|
if people and request.method == "POST":
|
||||||
index = people.index(Person(request.form["name"]))
|
newPerson = Person(request.form["name"])
|
||||||
print(index)
|
if newPerson in people:
|
||||||
people[index].status += 1
|
index = people.index(newPerson)
|
||||||
if people[index].status == 3:
|
print(index)
|
||||||
people.remove(people[index])
|
people[index].status += 1
|
||||||
|
if people[index].status == 3:
|
||||||
|
people.remove(people[index])
|
||||||
return redirect("/")
|
return redirect("/")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue