fds
This commit is contained in:
parent
6abedad12b
commit
272f0c36b1
1 changed files with 4 additions and 2 deletions
|
@ -38,11 +38,13 @@ tiers={
|
||||||
@app.get("/sex")
|
@app.get("/sex")
|
||||||
@admin_level_required(3)
|
@admin_level_required(3)
|
||||||
def sex(v):
|
def sex(v):
|
||||||
for u in g.db.query(User).filter(User.patron > 0, User.patron != 5).all():
|
for u in g.db.query(User).filter(User.patron > 0, User.patron != 5, User.email != None).all():
|
||||||
data = {'access_token': GUMROAD_TOKEN, 'email': u.email}
|
data = {'access_token': GUMROAD_TOKEN, 'email': u.email}
|
||||||
response = requests.get('https://api.gumroad.com/v2/sales', data=data).json()["sales"]
|
response = requests.get('https://api.gumroad.com/v2/sales', data=data).json()["sales"]
|
||||||
|
|
||||||
if len(response) == 0: print(f"{u.username}: email not found")
|
if len(response) == 0:
|
||||||
|
print(f"{u.username}: email not found")
|
||||||
|
continue
|
||||||
|
|
||||||
response = response[0]
|
response = response[0]
|
||||||
tier = tiers[response["variants_and_quantity"]]
|
tier = tiers[response["variants_and_quantity"]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue