Skip to content

Commit

Permalink
Add ValidateIfSession for savings and investments fields
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMillar-MOJ committed Mar 7, 2025
1 parent 1da25c1 commit 3969bf6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/means_test/forms/savings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class SavingsForm(BaseMeansTestForm):
"The total amount of savings in cash, bank or building society; or enter 0 if you have none"
),
validators=[
InputRequired(message=_("Enter your total savings, or 0 if you have none"))
ValidateIfSession("has_savings", True),
InputRequired(message=_("Enter your total savings, or 0 if you have none")),
],
)

Expand All @@ -31,9 +32,10 @@ class SavingsForm(BaseMeansTestForm):
"This includes stocks, shares, bonds (but not property); enter 0 if you have none"
),
validators=[
ValidateIfSession("has_savings", True),
InputRequired(
message=_("Enter your total investments, or 0 if you have none")
)
),
],
)

Expand Down

0 comments on commit 3969bf6

Please sign in to comment.