diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/services/concerns/spam_check_methods.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'app/services/concerns/spam_check_methods.rb')
-rw-r--r-- | app/services/concerns/spam_check_methods.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/services/concerns/spam_check_methods.rb b/app/services/concerns/spam_check_methods.rb index 53e9e001463..939f8f183ab 100644 --- a/app/services/concerns/spam_check_methods.rb +++ b/app/services/concerns/spam_check_methods.rb @@ -22,15 +22,18 @@ module SpamCheckMethods # a dirty instance, which means it should be already assigned with the new # attribute values. # rubocop:disable Gitlab/ModuleWithInstanceVariables - def spam_check(spammable, user) + def spam_check(spammable, user, action:) + raise ArgumentError.new('Please provide an action, such as :create') unless action + Spam::SpamActionService.new( spammable: spammable, - request: @request + request: @request, + user: user, + context: { action: action } ).execute( api: @api, recaptcha_verified: @recaptcha_verified, - spam_log_id: @spam_log_id, - user: user) + spam_log_id: @spam_log_id) end # rubocop:enable Gitlab/ModuleWithInstanceVariables end |