diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-14 21:09:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-14 21:09:44 +0000 |
commit | dc60045db7aab599453799c75190b93692d91b7c (patch) | |
tree | c566543274529c4427b5721a2de3c7230e03c198 /app/services/snippets | |
parent | 06ac12d53c3f0b7cee2755a1254bf1af05d55044 (diff) | |
download | gitlab-ce-dc60045db7aab599453799c75190b93692d91b7c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/snippets')
-rw-r--r-- | app/services/snippets/create_service.rb | 14 | ||||
-rw-r--r-- | app/services/snippets/update_service.rb | 14 |
2 files changed, 12 insertions, 16 deletions
diff --git a/app/services/snippets/create_service.rb b/app/services/snippets/create_service.rb index d9a46890c45..6d3b63de9fd 100644 --- a/app/services/snippets/create_service.rb +++ b/app/services/snippets/create_service.rb @@ -20,14 +20,12 @@ module Snippets @snippet.author = current_user - if Feature.enabled?(:snippet_spam) - Spam::SpamActionService.new( - spammable: @snippet, - spam_params: spam_params, - user: current_user, - action: :create - ).execute - end + Spam::SpamActionService.new( + spammable: @snippet, + spam_params: spam_params, + user: current_user, + action: :create + ).execute if save_and_commit UserAgentDetailService.new(spammable: @snippet, spam_params: spam_params).create diff --git a/app/services/snippets/update_service.rb b/app/services/snippets/update_service.rb index f8374cc88bb..d83b21271c0 100644 --- a/app/services/snippets/update_service.rb +++ b/app/services/snippets/update_service.rb @@ -23,14 +23,12 @@ module Snippets update_snippet_attributes(snippet) - if Feature.enabled?(:snippet_spam) - Spam::SpamActionService.new( - spammable: snippet, - spam_params: spam_params, - user: current_user, - action: :update - ).execute - end + Spam::SpamActionService.new( + spammable: snippet, + spam_params: spam_params, + user: current_user, + action: :update + ).execute if save_and_commit(snippet) Gitlab::UsageDataCounters::SnippetCounter.count(:update) |