mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 03:30:33 +02:00
Refactor
This commit is contained in:
parent
cd4486c79c
commit
bfb9abea8c
4 changed files with 10 additions and 9 deletions
|
@ -12,7 +12,6 @@ module Epp::Common
|
|||
end
|
||||
|
||||
def proxy
|
||||
@errors = []
|
||||
@svTRID = "ccReg-#{'%010d' % rand(10 ** 10)}"
|
||||
send(params[:command])
|
||||
end
|
||||
|
@ -25,6 +24,10 @@ module Epp::Common
|
|||
EppSession.find_or_initialize_by(session_id: cookies['session'])
|
||||
end
|
||||
|
||||
def epp_errors
|
||||
@errors ||= []
|
||||
end
|
||||
|
||||
def current_epp_user
|
||||
@current_epp_user ||= EppUser.find(epp_session[:epp_user_id]) if epp_session[:epp_user_id]
|
||||
end
|
||||
|
@ -36,9 +39,8 @@ module Epp::Common
|
|||
xsd = Nokogiri::XML::Schema(File.read("doc/schemas/#{type}-1.0.xsd"))
|
||||
doc = Nokogiri::XML(params[:frame])
|
||||
ext_values = xsd.validate(doc)
|
||||
@errors = []
|
||||
if ext_values.any?
|
||||
@errors << {code: '2001', msg: 'Command syntax error', ext_values: ext_values}
|
||||
epp_errors << {code: '2001', msg: 'Command syntax error', ext_values: ext_values}
|
||||
render '/epp/error' and return
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,8 +2,7 @@ class Epp::ErrorsController < ApplicationController
|
|||
include Epp::Common
|
||||
|
||||
def error
|
||||
@errors = []
|
||||
@errors << {code: params[:code], msg: params[:msg]}
|
||||
epp_errors << {code: params[:code], msg: params[:msg]}
|
||||
render '/epp/error'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue