Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLDC-3850: Clear postcode_known when clearing postcode_full #2910

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/models/log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ def field_formatted_as_currency(field_name)
end

def blank_compound_invalid_non_setup_fields!
if errors.attribute_names.include? :postcode_full
self.postcode_known = nil if lettings?
self.pcodenk = nil if sales?
end

self.ppcodenk = nil if errors.attribute_names.include? :ppostcode_full
self.previous_la_known = nil if errors.attribute_names.include? :prevloc

Expand All @@ -258,6 +263,8 @@ def blank_compound_invalid_non_setup_fields!
self.address_line2 = nil
self.town_or_city = nil
self.postcode_full = nil
self.postcode_known = nil if lettings?
self.pcodenk = nil if sales?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm struggling to get a unit test which actually isolates the problem here - suggest we try and merge this anyway (with manual testing) and I'll look at putting one in separately.

self.county = nil
process_postcode_changes!
end
Expand Down
Loading