feat: Restrict to gift once per ip
All checks were successful
Build Docker / Build Image (push) Successful in 18s
All checks were successful
Build Docker / Build Image (push) Successful in 18s
This commit is contained in:
parent
8ddb039ca4
commit
c200839b8e
2
gift.py
2
gift.py
@ -34,6 +34,8 @@ def gift(name,email,referer, ip):
|
|||||||
for gift in gifts:
|
for gift in gifts:
|
||||||
if gift['email'] == email:
|
if gift['email'] == email:
|
||||||
return "You have already submitted a gift request"
|
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
|
# Add the user to the list
|
||||||
gifts.append({
|
gifts.append({
|
||||||
|
1
main.py
1
main.py
@ -45,7 +45,6 @@ def submit():
|
|||||||
|
|
||||||
status = gift.gift(name, email, hidden, ip)
|
status = gift.gift(name, email, hidden, ip)
|
||||||
print(status,flush=True)
|
print(status,flush=True)
|
||||||
print(request.headers,flush=True)
|
|
||||||
|
|
||||||
if status == True:
|
if status == True:
|
||||||
return render_template('success.html')
|
return render_template('success.html')
|
||||||
|
Loading…
Reference in New Issue
Block a user