diff --git a/app/controllers/registrant/domains_controller.rb b/app/controllers/registrant/domains_controller.rb index 116ece8..8eb5009 100644 --- a/app/controllers/registrant/domains_controller.rb +++ b/app/controllers/registrant/domains_controller.rb @@ -54,6 +54,16 @@ def edit; end def create # TODO: Need to add validation for ident of contacts, email and other attributes + unless DomainPrice.all.any? + flash.now[:alert] = t('.no_domain_prices') + + render turbo_stream: [ + turbo_stream.append('flash', partial: 'layouts/flash') + ] + + return + end + domain_price = DomainPrice.find(domain_params[:domain_price]) pending = PendingAction.create( diff --git a/app/controllers/registrant/profiles_controller.rb b/app/controllers/registrant/profiles_controller.rb index 5d3a08a..fe7a9c8 100644 --- a/app/controllers/registrant/profiles_controller.rb +++ b/app/controllers/registrant/profiles_controller.rb @@ -16,7 +16,7 @@ def update def user_params params.require(:user).permit( - :name, :email, :phone, :phone_code, :ident, :role, :country_code, + :name, :email, :phone, :phone_code, :ident, :country_code, :city, :street, :zip, :state, :legal_document, :code ) end diff --git a/app/models/user.rb b/app/models/user.rb index 525fc2e..19dfa01 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -38,6 +38,8 @@ def self.from_omniauth(tara_params) user = User.find_or_initialize_by(ident:) user.name = full_name user.ident = ident + user.role = User.roles[:priv] + user.phone = tara_params.dig('info', 'phone_number') if user.phone.blank? user end diff --git a/app/views/registrant/profiles/_form.html.erb b/app/views/registrant/profiles/_form.html.erb index eb0b6cf..89177df 100644 --- a/app/views/registrant/profiles/_form.html.erb +++ b/app/views/registrant/profiles/_form.html.erb @@ -7,10 +7,6 @@ <%= component 'form/text_input', form: form, attribute: :ident, heroicon_name: 'identification', placeholder: '2323232323', options: { readonly: true } %> -