Do not log object type when frame missing

This commit is contained in:
Martin Lensment 2015-01-12 16:12:02 +02:00
parent 4cb2fc93a6
commit 9e5e8ea100

View file

@ -120,11 +120,13 @@ module Epp::Common
end end
def write_to_epp_log def write_to_epp_log
request_object = OBJECT_TYPES[params_hash['epp']['xmlns:ns2']] if params[:frame]
ApiLog::EppLog.create!({ ApiLog::EppLog.create!({
request: params[:frame], request: params[:frame],
request_command: params[:command], request_command: params[:command],
request_successful: epp_errors.empty?, request_successful: epp_errors.empty?,
request_object: OBJECT_TYPES[params_hash['epp']['xmlns:ns2']], request_object: request_object,
response: @response, response: @response,
api_user_name: @epp_user.try(:to_s) || current_epp_user.try(:to_s), api_user_name: @epp_user.try(:to_s) || current_epp_user.try(:to_s),
api_user_registrar: @epp_user.try(:registrar).try(:to_s) || current_epp_user.try(:registrar).try(:to_s) api_user_registrar: @epp_user.try(:registrar).try(:to_s) || current_epp_user.try(:registrar).try(:to_s)