From 2580d5efb08ba0f8b445bbb0e4b9da99feafc873 Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Mon, 1 Jun 2015 13:24:40 +0300 Subject: [PATCH] No counter update when no current user #2348 --- app/controllers/epp_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/epp_controller.rb b/app/controllers/epp_controller.rb index 07a3aa732..1c8f25323 100644 --- a/app/controllers/epp_controller.rb +++ b/app/controllers/epp_controller.rb @@ -1,4 +1,5 @@ class EppController < ApplicationController + include Iptable layout false protect_from_forgery with: :null_session skip_before_action :verify_authenticity_token @@ -286,6 +287,7 @@ class EppController < ApplicationController def iptables_counter_update return if ENV['iptables_counter_enabled'].blank? && ENV['iptables_counter_enabled'] != 'true' - Iptable.counter_update(current_user.registrar_code, request.remote_ip) + return if current_user.blank? + counter_update(current_user.registrar_code, request.remote_ip) end end