fixed codeclimate errors

This commit is contained in:
dinsmol 2021-09-09 21:34:56 +03:00
parent e0c47cdb35
commit 788af6cc5f
15 changed files with 32 additions and 31 deletions

View file

@ -1,5 +1,5 @@
module Epp
class BaseController < ActionController::Base
class BaseController < ApplicationController
class AuthorizationError < StandardError; end
skip_before_action :verify_authenticity_token
check_authorization

View file

@ -35,15 +35,13 @@ class Registrar
@depp_user.errors.add(:base, :invalid_cert)
end
if @depp_user.errors.none?
if @api_user.active?
sign_in_and_redirect(:registrar_user, @api_user)
else
@depp_user.errors.add(:base, :not_active)
show_error and return
end
show_error and return unless @depp_user.errors.none?
if @api_user.active?
sign_in_and_redirect(:registrar_user, @api_user)
else
show_error and return
@depp_user.errors.add(:base, :not_active)
show_error
end
end