Donate impose min and max 00

This commit is contained in:
Jeremy Zhang 2019-01-08 05:23:42 +00:00
parent 28d5436f99
commit 0a0be1a83b
2 changed files with 7 additions and 3 deletions

View File

@ -441,7 +441,11 @@ def donate_post():
if not donation_amount: if not donation_amount:
abort(402) abort(402)
donation_amount = "{0:.2f}".format(float(donation_amount)) donation_amount = float(donation_amount)
if donation_amount < 5 or donation_amount > 100:
abort(412)
donation_amount = "{0:.2f}".format(donation_amount)
payer = {"payment_method": "paypal"} payer = {"payment_method": "paypal"}
items = [{"name": "TitanEmbeds Donation", items = [{"name": "TitanEmbeds Donation",
"price": donation_amount, "price": donation_amount,

View File

@ -11,9 +11,9 @@
<h4>The Name-Your-Price Tool</h4> <h4>The Name-Your-Price Tool</h4>
<p class="flow-text">Donate to receive <strong>Titan Tokens&trade;</strong> (to be spent on donator features below) and a <strong>supporter role</strong> on our support server.</p> <p class="flow-text">Donate to receive <strong>Titan Tokens&trade;</strong> (to be spent on donator features below) and a <strong>supporter role</strong> on our support server.</p>
<p class="range-field"> <p class="range-field">
<input type="range" id="token-slider" min="1" max="100" value="5" /> <input type="range" id="token-slider" min="5" max="100" value="10" />
</p> </p>
<p class="flow-text">$<span id="money-display">5</span> for <strong><span id="token-display">500</span> tokens</strong>!</p> <p class="flow-text">$<span id="money-display">10</span> for <strong><span id="token-display">1000</span> tokens</strong>!</p>
<a class="waves-effect waves-light btn" id="donate-btn">Donate</a> <a class="waves-effect waves-light btn" id="donate-btn">Donate</a>
</div> </div>
</div> </div>