Add and Remove buttons not responding. Python, Flask

I am working through the Tourist Attractions app in the Flask course. Things are going well but I have an issue where the Add and Remove buttons are not working. I have reviewed code from other postings and I believe I have the correct code, but I just cannot get the buttons to do anything. I am at step 12 in the project and by now the buttons should be doing something. Here is some code from what I have done.

This is from the file:

@app.route("/<category>", methods=["GET", "POST"]) def locations(category): locations = visit.get_list_by_category(category) ## Check the request for form data and process if request.method == "POST": [(name, action)] = request.form.items() if action == UP_ACTION: visit.moveup(name) elif action == DEL_ACTION: visit.delete(name) ## Return the main template with variables return render_template("locations.html", category=category, categories=categories, locations=locations, add_location=AddLocationForm())

This is from the locations.html:

{% if location.category in ["recommended","tovisit"] %} <form method="POST"> <input type="submit" class="up" name="location[name]" value="Add" /> <!-- set name attribute here --> <input type="submit" class="del" name="location[name]" value="Remove" />

Any help is much appreciated. :smile: