fds
This commit is contained in:
parent
272f0c36b1
commit
8c800eda24
2 changed files with 20 additions and 19 deletions
|
@ -26,32 +26,14 @@ IMGUR_KEY = environ.get("IMGUR_KEY").strip()
|
|||
GUMROAD_ID = environ.get("GUMROAD_ID", "tfcvri").strip()
|
||||
|
||||
tiers={
|
||||
"(LlamaBean)": 1,
|
||||
"(Paypig)": 1,
|
||||
"(Renthog)": 2,
|
||||
"(Landchad)": 3,
|
||||
"(Terminally online turboautist)": 4,
|
||||
"(Rich Bich)": 5,
|
||||
"(LlamaBean)": 1,
|
||||
}
|
||||
|
||||
|
||||
@app.get("/sex")
|
||||
@admin_level_required(3)
|
||||
def sex(v):
|
||||
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}
|
||||
response = requests.get('https://api.gumroad.com/v2/sales', data=data).json()["sales"]
|
||||
|
||||
if len(response) == 0:
|
||||
print(f"{u.username}: email not found")
|
||||
continue
|
||||
|
||||
response = response[0]
|
||||
tier = tiers[response["variants_and_quantity"]]
|
||||
if u.patron != tier:
|
||||
print(f"{u.username}: patron {u.patron} tier {tier}")
|
||||
return "sex"
|
||||
|
||||
@app.post("/settings/removebackground")
|
||||
@limiter.limit("1/second")
|
||||
@auth_required
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue