From bb4281270cefb5011eaad130d254fb971de62fb5 Mon Sep 17 00:00:00 2001 From: Maveth Date: Tue, 23 Nov 2021 12:24:14 -0600 Subject: [PATCH 1/2] Fix error caused by negative or really big numbers --- capsulflask/payment.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/capsulflask/payment.py b/capsulflask/payment.py index a2e104e..8e10b61 100644 --- a/capsulflask/payment.py +++ b/capsulflask/payment.py @@ -36,10 +36,11 @@ def validate_dollars(): dollars = decimal.Decimal(request.form["dollars"]) except: errors.append("dollars must be a number") - - # TODO re enable this - # if dollars and dollars < decimal.Decimal(1): - # errors.append("dollars must be >= 1") + + if dollars and dollars < decimal.Decimal(1): + errors.append("dollars must be >= 1") + elif dollars and dollars >= decimal.Decimal(1000000): + errors.append("dollars must be < 1,000,000") return [errors, dollars] -- 2.40.1 From 9d74c99ce8c8bd737ff528716c258ee651646a23 Mon Sep 17 00:00:00 2001 From: Maveth Date: Tue, 23 Nov 2021 12:24:34 -0600 Subject: [PATCH 2/2] Update View Source link to working URL --- capsulflask/templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/capsulflask/templates/base.html b/capsulflask/templates/base.html index 43f6266..c7564bd 100644 --- a/capsulflask/templates/base.html +++ b/capsulflask/templates/base.html @@ -51,7 +51,7 @@     A service by Cyberia Computer Club 2020-


- View page source + View page source -- 2.40.1