Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4a770dc7
Commit
4a770dc7
authored
Sep 30, 2021
by
Jayson Salazar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop overriding spamcheck verdicts !=ALLOW
parent
9998e460
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
13 deletions
+6
-13
app/services/spam/spam_verdict_service.rb
app/services/spam/spam_verdict_service.rb
+4
-11
spec/services/spam/spam_verdict_service_spec.rb
spec/services/spam/spam_verdict_service_spec.rb
+2
-2
No files found.
app/services/spam/spam_verdict_service.rb
View file @
4a770dc7
...
...
@@ -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
return
[
nil
,
attribs
]
unless
result
[
result
,
attribs
]
end
rescue
StandardError
=>
e
Gitlab
::
ErrorTracking
.
log_exception
(
e
)
...
...
spec/services/spam/spam_verdict_service_spec.rb
View file @
4a770dc7
...
...
@@ -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
::
DIS
ALLOW
::
Spam
::
SpamConstants
::
BLOCK_USER
|
::
Spam
::
SpamConstants
::
BLOCK_USER
end
# rubocop: enable Lint/BinaryOperatorWithIdenticalOperands
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment