dfdf
This commit is contained in:
parent
2ba1197c9e
commit
4d2b8dd38b
1 changed files with 5 additions and 7 deletions
|
@ -209,10 +209,8 @@ def themecolor(v):
|
||||||
@auth_required
|
@auth_required
|
||||||
@validate_formkey
|
@validate_formkey
|
||||||
def gumroad(v):
|
def gumroad(v):
|
||||||
#if not (v.email and v.is_activated):
|
if not (v.email and v.is_activated):
|
||||||
#return render_template("settings_profile.html",
|
return {"error": "You must have to a verified email to verify patron status"}, 400
|
||||||
#v=v,
|
|
||||||
#error="You must have to a verified email to verify patron status")
|
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
'access_token': GUMROAD_TOKEN,
|
'access_token': GUMROAD_TOKEN,
|
||||||
|
@ -221,12 +219,12 @@ def gumroad(v):
|
||||||
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:
|
if len(response) == 0:
|
||||||
return jsonify({"error": "Email not found"}), 404
|
return {"error": "Email not found"}, 404
|
||||||
|
|
||||||
response = response[0]
|
response = response[0]
|
||||||
tier = tiers[response["variants_and_quantity"]]
|
tier = tiers[response["variants_and_quantity"]]
|
||||||
if v.patron == tier:
|
if v.patron == tier:
|
||||||
return jsonify({"error": "Patron awards already claimed"}), 400
|
return {"error": "Patron awards already claimed"}, 400
|
||||||
|
|
||||||
v.patron = tier
|
v.patron = tier
|
||||||
|
|
||||||
|
@ -269,7 +267,7 @@ def gumroad(v):
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
|
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
return jsonify({"message": "Patron awards claimed"})
|
return {"message": "Patron awards claimed"}
|
||||||
|
|
||||||
@app.post("/settings/titlecolor")
|
@app.post("/settings/titlecolor")
|
||||||
@auth_required
|
@auth_required
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue