From 883b5de7a73417c8be05c6303687be0fb9eda274 Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Fri, 15 Mar 2024 08:34:40 +0200 Subject: [PATCH] fixed nameserver issue --- app/controllers/registrant/domains_controller.rb | 2 ++ app/views/registrant/domains/_form.html.erb | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/registrant/domains_controller.rb b/app/controllers/registrant/domains_controller.rb index 6580b1c..116ece8 100644 --- a/app/controllers/registrant/domains_controller.rb +++ b/app/controllers/registrant/domains_controller.rb @@ -18,6 +18,8 @@ def new end Tld::Estonian::MIN_NAMESERVER_COUNT.times do |i| + next if Setting.default_nameserver_records[i].blank? + current_nameserver = JSON.parse(Setting.default_nameserver_records[i]) @domain.nameservers.build( hostname: current_nameserver['hostname'], diff --git a/app/views/registrant/domains/_form.html.erb b/app/views/registrant/domains/_form.html.erb index 9bd9a16..ba1827f 100644 --- a/app/views/registrant/domains/_form.html.erb +++ b/app/views/registrant/domains/_form.html.erb @@ -9,9 +9,15 @@
Price list
- <% DomainPrice.all.each do |price| %> - <%= form.radio_button :domain_price, price.id, checked: DomainPrice.first == price ? true : false %> <%= price.price %> - <%= price.duration / 1.month %> months
+ + <% if DomainPrice.all.any? %> + <% DomainPrice.all.each do |price| %> + <%= form.radio_button :domain_price, price.id, checked: DomainPrice.first == price ? true : false %> <%= price.price %> - <%= price.duration / 1.month %> months
+ <% end %> + <% else %> + <%= t('.no_price_lists') %> <% end %> +
<%= component 'divider', label: t('.optional') %>