diff --git a/shop.py b/shop.py index f5eefef..f458f6d 100644 --- a/shop.py +++ b/shop.py @@ -48,6 +48,10 @@ def getItem(rowID): query = f"UPDATE shoplist set gotten = 1 where rowid = {rowID}" runQuery(query) +def unGetItem(rowID): + query = f"UPDATE shoplist set gotten = 0 where rowid = {rowID}" + runQuery(query) + app = Flask(__name__) app.config["DEBUG"] = True app.secret_key = b'*$#@U9423jr92jioJKL_)_;dasfj()12' @@ -80,6 +84,9 @@ def handle_data(): if "got" in request.form: getItem(request.form["got"]) + if "ungot" in request.form: + unGetItem(request.form["ungot"]) + if "loginform" in request.form: if request.form["password"] == "theloves2020": session["allowed"] = "allowed" diff --git a/templates/list.html b/templates/list.html index 3210669..cd523be 100644 --- a/templates/list.html +++ b/templates/list.html @@ -14,7 +14,7 @@ {% if x[3] == 0 %}
{% else %} - yes +
{% endif %}