Skip to content

Commit

Permalink
Merge pull request #469 from alphagov/remove-abbreviation
Browse files Browse the repository at this point in the history
Change use of abbreviation to primary hostname
  • Loading branch information
brucebolt authored Dec 14, 2023
2 parents 9465735 + 2f39a7c commit 46466c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bouncer/outcome/global_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def serve
when "archive"
[410, { "Content-Type" => "text/html" }, [renderer.render(context.attributes_for_render, 410)]]
else
message = "Can't serve unexpected global_type: #{context.site.global_type} for #{context.site.abbr}"
message = "Can't serve unexpected global_type: #{context.site.global_type} for #{context.site.default_hostname}"
[500, { "Content-Type" => "text/plain" }, [message]]
end
end
Expand Down
4 changes: 4 additions & 0 deletions lib/site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ class Site < ActiveRecord::Base
belongs_to :organisation
has_many :hosts
has_many :mappings

def default_hostname
@default_hostname ||= hosts.where(canonical_host_id: nil).order(:id).first.hostname
end
end

0 comments on commit 46466c9

Please sign in to comment.