This commit is contained in:
parent
30c723cebb
commit
6e2f4bd814
4
gift.py
4
gift.py
@ -25,7 +25,7 @@ if os.getenv('max_gifts_per_interval') == 'true':
|
|||||||
if os.getenv('interval') == 'true':
|
if os.getenv('interval') == 'true':
|
||||||
interval = int(os.getenv('interval'))
|
interval = int(os.getenv('interval'))
|
||||||
|
|
||||||
def gift(name,email,referer, ip):
|
def gift(name,email,referer, ip,api=False):
|
||||||
global loaded
|
global loaded
|
||||||
global gifts
|
global gifts
|
||||||
global previous_gifts
|
global previous_gifts
|
||||||
@ -59,7 +59,7 @@ def gift(name,email,referer, ip):
|
|||||||
loaded = True
|
loaded = True
|
||||||
|
|
||||||
# Check if the user has already submitted
|
# Check if the user has already submitted
|
||||||
if ip != os.getenv('admin_ip'):
|
if ip != os.getenv('admin_ip') and not api:
|
||||||
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"
|
||||||
|
2
main.py
2
main.py
@ -100,7 +100,7 @@ def api():
|
|||||||
return jsonify({'error': 'Invalid email address', 'success': False})
|
return jsonify({'error': 'Invalid email address', 'success': False})
|
||||||
|
|
||||||
|
|
||||||
status = gift.gift(name, email, "api", ip)
|
status = gift.gift(name, email, "api", ip,True)
|
||||||
print(status,flush=True)
|
print(status,flush=True)
|
||||||
|
|
||||||
if status == True:
|
if status == True:
|
||||||
|
Loading…
Reference in New Issue
Block a user