mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
Fix some CC issues
This commit is contained in:
parent
6d96a09b5c
commit
951a3f247b
2 changed files with 6 additions and 6 deletions
|
@ -12,11 +12,11 @@ module Repp
|
||||||
|
|
||||||
after_action do
|
after_action do
|
||||||
ApiLog::ReppLog.create(
|
ApiLog::ReppLog.create(
|
||||||
{ request_path: request.path, request_method: request.request_method,
|
request_path: request.path, request_method: request.request_method,
|
||||||
request_params: request.params.except('route_info').to_json, uuid: request.try(:uuid),
|
request_params: request.params.except('route_info').to_json, uuid: request.try(:uuid),
|
||||||
response: @response.to_json, response_code: status, ip: request.ip,
|
response: @response.to_json, response_code: status, ip: request.ip,
|
||||||
api_user_name: current_user.try(:username),
|
api_user_name: current_user.try(:username),
|
||||||
api_user_registrar: current_user.try(:registrar).try(:to_s) }
|
api_user_registrar: current_user.try(:registrar).try(:to_s)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -50,9 +50,9 @@ module Repp
|
||||||
|
|
||||||
def transferable_domain(domain_name, transfer_code)
|
def transferable_domain(domain_name, transfer_code)
|
||||||
domain = Domain.find_by(name: domain_name)
|
domain = Domain.find_by(name: domain_name)
|
||||||
valid_transfer_code = domain.transfer_code == transfer_code
|
|
||||||
# rubocop:disable Style/AndOr
|
# rubocop:disable Style/AndOr
|
||||||
add_error("#{domain_name} does not exist") and return unless domain
|
add_error("#{domain_name} does not exist") and return unless domain
|
||||||
|
valid_transfer_code = domain.transfer_code.eql?(transfer_code)
|
||||||
add_error("#{domain_name} transfer code is wrong") and return unless valid_transfer_code
|
add_error("#{domain_name} transfer code is wrong") and return unless valid_transfer_code
|
||||||
# rubocop:enable Style/AndOr
|
# rubocop:enable Style/AndOr
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue