Skip to content

Commit

Permalink
Hotfix: Correctly set DR regions for users who had a valid region set…
Browse files Browse the repository at this point in the history
… before
  • Loading branch information
gregorbg committed Oct 28, 2024
1 parent 4a2c67b commit 6307efb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,16 @@ def acknowledge_cookies
if user_params.key?(:delegate_reports_region)
raw_region = user_params.delete(:delegate_reports_region)

if raw_region.starts_with?('_')
if raw_region.blank?
# Explicitly reset the region type column when "worldwide" (represented by a blank value) was selected
user_params[:delegate_reports_region_type] = nil
elsif raw_region.starts_with?('_')
user_params[:delegate_reports_region_type] = 'Continent'
else
user_params[:delegate_reports_region_type] = 'Country'
end

user_params[:delegate_reports_region_id] = raw_region
user_params[:delegate_reports_region_id] = raw_region.presence
end
end
end
Expand Down

0 comments on commit 6307efb

Please sign in to comment.