Fix error caused by negative or really big numbers
This commit is contained in:
parent
ee5eb13bec
commit
bb4281270c
@ -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]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user