diff options
-rw-r--r-- | lib/gitlab/auth/activity.rb | 4 | ||||
-rw-r--r-- | spec/support/matchers/metric_counter_matcher.rb (renamed from spec/support/prometheus/custom_matchers.rb) | 0 |
2 files changed, 1 insertions, 3 deletions
diff --git a/lib/gitlab/auth/activity.rb b/lib/gitlab/auth/activity.rb index e09ba2eeabc..d5d1428ba58 100644 --- a/lib/gitlab/auth/activity.rb +++ b/lib/gitlab/auth/activity.rb @@ -32,9 +32,7 @@ module Gitlab self.class.user_password_invalid_counter_increment! end - if @user.present? && @user.blocked? - self.class.user_blocked_counter_increment! - end + self.class.user_blocked_counter_increment! if @user&.blocked? end def user_authenticated! diff --git a/spec/support/prometheus/custom_matchers.rb b/spec/support/matchers/metric_counter_matcher.rb index 22d5cd17e3f..22d5cd17e3f 100644 --- a/spec/support/prometheus/custom_matchers.rb +++ b/spec/support/matchers/metric_counter_matcher.rb |