From c200839b8ebaa01190040e05c6fbeb485e434ce6 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Tue, 7 Nov 2023 23:18:49 +1100 Subject: [PATCH] feat: Restrict to gift once per ip --- gift.py | 2 ++ main.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gift.py b/gift.py index 84bcaee..3389852 100644 --- a/gift.py +++ b/gift.py @@ -34,6 +34,8 @@ def gift(name,email,referer, ip): for gift in gifts: if gift['email'] == email: return "You have already submitted a gift request" + if gift['ip'] == ip: + return "You have already submitted a gift request" # Add the user to the list gifts.append({ diff --git a/main.py b/main.py index 3be030c..f947dc8 100644 --- a/main.py +++ b/main.py @@ -45,7 +45,6 @@ def submit(): status = gift.gift(name, email, hidden, ip) print(status,flush=True) - print(request.headers,flush=True) if status == True: return render_template('success.html')