From 7d55e949fccd16253ccd3335866e3d73338314e1 Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Thu, 13 Jul 2023 18:14:06 +0200 Subject: [PATCH] Validate expenseForm.Text only once --- pkg/expenses.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/expenses.go b/pkg/expenses.go index d753bd8..102f04b 100644 --- a/pkg/expenses.go +++ b/pkg/expenses.go @@ -266,8 +266,6 @@ func (form *expenseForm) Validate() bool { if validator.CheckRequiredInput(form.Amount, gettext("Amount can not be empty.", form.locale)) { validator.CheckValidDecimal(form.Amount, form.company.MinCents(), math.MaxFloat64, gettext("Amount must be a number greater than zero.", form.locale)) } - validator.CheckValidSelectOption(form.Tax, gettext("Selected tax is not valid.", form.locale)) - validator.CheckAtMostOneOfEachGroup(form.Tax, gettext("You can only select a tax of each class.", form.locale)) validator.CheckValidSelectOption(form.ExpenseStatus, gettext("Selected expense status is not valid.", form.locale)) return validator.AllOK() }