feat: Restrict to gift once per ip
All checks were successful
Build Docker / Build Image (push) Successful in 18s

This commit is contained in:
Nathan Woodburn 2023-11-07 23:18:49 +11:00
parent 8ddb039ca4
commit c200839b8e
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 2 additions and 1 deletions

View File

@ -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({

View File

@ -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')