diff options
| author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-21 12:07:45 +0000 |
|---|---|---|
| committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-21 12:07:45 +0000 |
| commit | d4c968c95c4b966a58d3fe76c25aeb6e97d84925 (patch) | |
| tree | b3d9237b97a50d813437d53eb9fbfd406417031f /app/graphql/mutations/snippets/create.rb | |
| parent | 3ab7e70965fd198aafefc5c1a0eaf7b695f6cabc (diff) | |
| download | gitlab-ce-d4c968c95c4b966a58d3fe76c25aeb6e97d84925.tar.gz | |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/graphql/mutations/snippets/create.rb')
| -rw-r--r-- | app/graphql/mutations/snippets/create.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/app/graphql/mutations/snippets/create.rb b/app/graphql/mutations/snippets/create.rb index d1ad0697acd..765163e73a1 100644 --- a/app/graphql/mutations/snippets/create.rb +++ b/app/graphql/mutations/snippets/create.rb @@ -49,7 +49,9 @@ module Mutations process_args_for_params!(args) - service_response = ::Snippets::CreateService.new(project: project, current_user: current_user, params: args).execute + spam_params = ::Spam::SpamParams.new_from_request(request: context[:request]) + service = ::Snippets::CreateService.new(project: project, current_user: current_user, params: args, spam_params: spam_params) + service_response = service.execute # Only when the user is not an api user and the operation was successful if !api_user? && service_response.success? @@ -81,12 +83,6 @@ module Mutations # it's the expected key param args[:files] = args.delete(:uploaded_files) - if Feature.enabled?(:snippet_spam) - args.merge!(additional_spam_params) - else - args[:disable_spam_action_service] = true - end - # Return nil to make it explicit that this method is mutating the args parameter, and that # the return value is not relevant and is not to be used. nil |
