Do not overwrite auth info on domain create #2833

This commit is contained in:
Martin Lensment 2015-08-13 11:42:54 +03:00
parent a447c8653c
commit eff8dd5d7a
3 changed files with 8 additions and 5 deletions

View file

@ -528,8 +528,13 @@ class Domain < ActiveRecord::Base
Registrant.find_by(id: pending_json['domain']['registrant_id'].last)
end
# rubocop:disable Lint/Loop
def generate_auth_info
return if auth_info.present?
generate_auth_info!
end
# rubocop:disable Lint/Loop
def generate_auth_info!
begin
self.auth_info = SecureRandom.hex
end while self.class.exists?(auth_info: auth_info)