diff --git a/app/models/contact.rb b/app/models/contact.rb index 7ebfaf684..fcebe8632 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -26,7 +26,7 @@ class Contact < ActiveRecord::Base validates :ident_country_code, presence: true, if: proc { |c| %w(org priv).include? c.ident_type }, on: :create validates :code, uniqueness: { message: :epp_id_taken }, - format: { with: /\A[\w\-\:]*\Z/i, message: :invalid }, + format: { with: /\A[\w\-\:\.\_]*\z/i, message: :invalid }, length: { maximum: 100, message: :too_long_contact_code } validate :ident_valid_format? validate :uniq_statuses? diff --git a/config/routes.rb b/config/routes.rb index f5b81e8b5..c1cc98697 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -67,7 +67,7 @@ Rails.application.routes.draw do # end # end - resources :contacts do + resources :contacts, constraints: {:id => /[^\/]+(?=#{ ActionController::Renderers::RENDERERS.map{|e| "\\.#{e}\\z"}.join("|") })|[^\/]+/} do member do get 'delete' end