fd
This commit is contained in:
parent
c997dc1f50
commit
3137f33661
2 changed files with 12 additions and 3 deletions
|
@ -287,8 +287,11 @@ def themecolor(v):
|
||||||
@auth_required
|
@auth_required
|
||||||
@validate_formkey
|
@validate_formkey
|
||||||
def gumroad(v):
|
def gumroad(v):
|
||||||
|
if 'rdrama' in request.host: patron = 'Paypig'
|
||||||
|
else: patron = 'Patron'
|
||||||
|
|
||||||
if not (v.email and v.is_activated):
|
if not (v.email and v.is_activated):
|
||||||
return {"error": "You must have a verified email to verify patron status and claim awards"}, 400
|
return {"error": f"You must have a verified email to verify {patron} status and claim your rewards"}, 400
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
'access_token': GUMROAD_TOKEN,
|
'access_token': GUMROAD_TOKEN,
|
||||||
|
@ -302,7 +305,7 @@ def gumroad(v):
|
||||||
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 {"error": "Patron awards already claimed"}, 400
|
return {"error": f"{patron} rewards already claimed"}, 400
|
||||||
|
|
||||||
v.patron = tier
|
v.patron = tier
|
||||||
|
|
||||||
|
@ -354,7 +357,7 @@ def gumroad(v):
|
||||||
g.db.add(new_badge)
|
g.db.add(new_badge)
|
||||||
|
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
return {"message": "Patron awards claimed"}
|
return {"message": f"{patron} rewards claimed!"}
|
||||||
|
|
||||||
@app.post("/settings/titlecolor")
|
@app.post("/settings/titlecolor")
|
||||||
@auth_required
|
@auth_required
|
||||||
|
|
|
@ -1374,6 +1374,12 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</pre>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue