diff --git a/app/models/validations/local_authority_validations.rb b/app/models/validations/local_authority_validations.rb index 94f02a745..23ac8c590 100644 --- a/app/models/validations/local_authority_validations.rb +++ b/app/models/validations/local_authority_validations.rb @@ -22,10 +22,10 @@ module Validations::LocalAuthorityValidations end if record.owning_organisation && record.owning_organisation.local_authorities.present? && - record.la && !record.owning_organisation.local_authorities.include?(record.la) - la_name = record.form.get_question("la", record).label_from_value(record.la) - org_name = record.owning_organisation.name - record.errors.add :la, I18n.t("validations.property.la.la_invalid_for_org", org_name:, la_name:) + record.la && !record.owning_organisation.local_authorities.include?(record.la) + la_name = record.form.get_question("la", record).label_from_value(record.la) + org_name = record.owning_organisation.name + record.errors.add :la, I18n.t("validations.property.la.la_invalid_for_org", org_name:, la_name:) end end