Commit 59c3e847 authored by jan-pieter's avatar jan-pieter

request.form.has_key() is depricated, so I changed it

parent 59e852f5
......@@ -44,12 +44,13 @@ def home():
@app.route("/statusUpdate", methods=["POST", "GET"])
def statusUpdate():
if people and request.method == "POST":
if request.form.has_key("index"):
result = request.form
if "index" in result:
index = int(request.form["index"])
people[index].status += 1
if people[index].status == 3:
people.remove(people[index])
if request.form.has_key("name"):
if "name" in result:
index = people.index(Person(request.form["name"]))
print(index)
people[index].status += 1
......@@ -62,7 +63,7 @@ def statusUpdate():
def addPerson():
if request.method == "POST":
result = request.form
if result.has_key("name"):
if "name" in result:
newPerson = Person(result["name"], result["remark"])
if newPerson not in people:
people.append(newPerson)
......
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