Refactor RegistrantUser class

* Extract frequently used country_code and ident methods
* Refactor domain query
* Add contact query method
* Add adminstrated_domains query method. Name will most likely change
  in the future developments
* Change registry locks integration test name
This commit is contained in:
Maciej Szlosarczyk 2018-08-23 16:00:44 +03:00
parent 9f7fc47f19
commit 9623e2fb97
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
6 changed files with 95 additions and 55 deletions

View file

@ -39,7 +39,8 @@ module Api
if decryptor.valid?
sign_in decryptor.user
else
render json: { errors: [{base: ['Not authorized']}] }, status: :unauthorized
render json: { errors: [{ base: ['Not authorized'] }] },
status: :unauthorized
end
end

View file

@ -25,7 +25,7 @@ module Api
private
def set_domain
domain_pool = associated_domains(current_user)
domain_pool = current_user.administrated_domains
@domain = domain_pool.find_by(uuid: params[:domain_uuid])
return if @domain