Commit 4a770dc7 authored by Jayson Salazar's avatar Jayson Salazar

Stop overriding spamcheck verdicts !=ALLOW

parent 9998e460
......@@ -73,18 +73,11 @@ module Spam
begin
result, attribs, _error = spamcheck_client.issue_spam?(spam_issue: target, user: user, context: context)
return [nil, attribs] unless result
# @TODO log if error is not nil https://gitlab.com/gitlab-org/gitlab/-/issues/329545
return [result, attribs] if result == NOOP || attribs["monitorMode"] == "true"
# Duplicate logic with Akismet logic in #akismet_verdict
if Gitlab::Recaptcha.enabled? && result != ALLOW
[CONDITIONAL_ALLOW, attribs]
else
[result, attribs]
end
return [nil, attribs] unless result
[result, attribs]
rescue StandardError => e
Gitlab::ErrorTracking.log_exception(e)
......
......@@ -267,8 +267,8 @@ RSpec.describe Spam::SpamVerdictService do
where(:verdict_value, :expected) do
::Spam::SpamConstants::ALLOW | ::Spam::SpamConstants::ALLOW
::Spam::SpamConstants::CONDITIONAL_ALLOW | ::Spam::SpamConstants::CONDITIONAL_ALLOW
::Spam::SpamConstants::DISALLOW | ::Spam::SpamConstants::CONDITIONAL_ALLOW
::Spam::SpamConstants::BLOCK_USER | ::Spam::SpamConstants::CONDITIONAL_ALLOW
::Spam::SpamConstants::DISALLOW | ::Spam::SpamConstants::DISALLOW
::Spam::SpamConstants::BLOCK_USER | ::Spam::SpamConstants::BLOCK_USER
end
# rubocop: enable Lint/BinaryOperatorWithIdenticalOperands
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment