Skip to content

Commit

Permalink
Merge pull request #76 from internetee/rest-whois-74
Browse files Browse the repository at this point in the history
Set contact form default locale to ET
  • Loading branch information
vohmar authored May 30, 2018
2 parents d672234 + 750fc9e commit 5efb468
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app/controllers/whois_records_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class WhoisRecordsController < ApplicationController
helper_method :ip_in_whitelist?
helper_method :contact_form_default_locale

def show
domain_name = SimpleIDN.to_unicode(params[:name].to_s).downcase
Expand Down Expand Up @@ -55,4 +56,8 @@ def ip_in_whitelist?
def captcha_solved?
verify_recaptcha
end

def contact_form_default_locale
:et
end
end
3 changes: 2 additions & 1 deletion app/views/whois_records/_private_person.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ json.admin_contacts do
end
end

json.contact_form_link new_contact_request_url({ domain_name: whois_record.name })
json.contact_form_link new_contact_request_url({ domain_name: whois_record.name,
locale: contact_form_default_locale })
2 changes: 1 addition & 1 deletion test/integration/whois_records/json_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_json_all_fields_are_present
'tech_contacts': [{'changed': 'Not Disclosed',
'email': 'Not Disclosed',
'name': 'Not Disclosed'}],
'contact_form_link': 'http://www.example.com/contact_requests/new?domain_name=privatedomain.test&locale=en'
'contact_form_link': 'http://www.example.com/contact_requests/new?domain_name=privatedomain.test&locale=et'
}.with_indifferent_access

get('/v1/privatedomain.test.json')
Expand Down

0 comments on commit 5efb468

Please sign in to comment.