Skip to content

Commit

Permalink
fix: cast amount for comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Nov 28, 2022
1 parent fe73bc7 commit 1c3f79d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion payments/overrides/payment_webform.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import frappe
from frappe.core.doctype.file import remove_file_by_url
from frappe.rate_limiter import rate_limit
from frappe.utils import cint
from frappe.website.doctype.web_form.web_form import WebForm

from payments.utils import get_payment_gateway_controller
Expand All @@ -18,7 +19,7 @@ def validate(self):
def validate_payment_amount(self):
if self.amount_based_on_field and not self.amount_field:
frappe.throw(frappe._("Please select a Amount Field."))
elif not self.amount_based_on_field and not self.amount > 0:
elif not self.amount_based_on_field and not cint(self.amount) > 0:
frappe.throw(frappe._("Amount must be greater than 0."))

def get_payment_gateway_url(self, doc):
Expand Down

0 comments on commit 1c3f79d

Please sign in to comment.