From 97cdfe374ba4e60a033d2c6b0ec49ac164289d3c Mon Sep 17 00:00:00 2001 From: oscar-richardson-softwire Date: Tue, 27 Jan 2026 17:08:54 +0000 Subject: [PATCH] Add error to location field --- app/models/validations/property_validations.rb | 2 +- config/locales/validations/lettings/property_information.en.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/validations/property_validations.rb b/app/models/validations/property_validations.rb index d18ec9b44..55669bd5e 100644 --- a/app/models/validations/property_validations.rb +++ b/app/models/validations/property_validations.rb @@ -103,7 +103,7 @@ module Validations::PropertyValidations record.errors.add :uprn, I18n.t("validations.lettings.property.uprn.la_not_valid_for_date", la: la.name) record.errors.add :uprn_selection, I18n.t("validations.lettings.property.uprn_selection.la_not_valid_for_date", la: la.name) record.errors.add :startdate, I18n.t("validations.lettings.property.startdate.la_not_valid_for_date", la: la.name) - elsif record.is_supported_housing? + elsif record.is_supported_housing? # TODO: revisit record.errors.add :location_id, I18n.t("validations.lettings.property.location_id.la_not_valid_for_date", la: la.name) record.errors.add :scheme_id, I18n.t("validations.lettings.property.scheme_id.la_not_valid_for_date", la: la.name) record.errors.add :startdate, I18n.t("validations.lettings.property.startdate.la_not_valid_for_date", la: la.name) diff --git a/config/locales/validations/lettings/property_information.en.yml b/config/locales/validations/lettings/property_information.en.yml index 9eec4b2f7..15ea86f0e 100644 --- a/config/locales/validations/lettings/property_information.en.yml +++ b/config/locales/validations/lettings/property_information.en.yml @@ -40,6 +40,7 @@ en: location_id: not_in_england: "It looks like you have selected a location outside of England. Only create logs for lettings in England." la_not_valid_for_date: "%{la} does not exist on the tenancy start date, due to a change in local authority names and boundaries. Please enter the local authority name in use on the tenancy start date" + postcode_does_not_match_scheme_location_postcode: "The postcode in the address does not match the postcode for the location in the scheme. Please review your answers to the address or UPRN question (whichever you answered) and the location question." startdate: postcode_not_in_england: "It looks like you have an entered a postcode outside of England. Only create logs for lettings in England." address_not_in_england: "It looks like you have entered an address outside of England. Only create logs for lettings in England."