diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-07-18 18:17:43 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-07-26 15:17:52 -0500 |
commit | f7807c5b68b59f6a5b984ee64a6c82a3bd993d92 (patch) | |
tree | 48e30fc7667ca0a2df6d67b9ee692aede869656d /lib/api/issues.rb | |
parent | 9c34fafb8b728358a516a25120aa5f28567eae48 (diff) | |
download | gitlab-ce-f7807c5b68b59f6a5b984ee64a6c82a3bd993d92.tar.gz |
Submit all issues on public projects to Akismet if enabled.
Diffstat (limited to 'lib/api/issues.rb')
-rw-r--r-- | lib/api/issues.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb index 9adbde04884..787d416b960 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -157,15 +157,13 @@ module API end project = user_project - text = [attrs[:title], attrs[:description]].reject(&:blank?).join("\n") - if check_for_spam?(project, current_user) && is_spam?(env, current_user, text) - create_spam_log(project, current_user, attrs, env) + issue = ::Issues::CreateService.new(project, current_user, attrs.merge({ request: request })).execute + + if issue.nil? render_api_error!({ error: 'Spam detected' }, 400) end - issue = ::Issues::CreateService.new(project, current_user, attrs).execute - if issue.valid? # Find or create labels and attach to issue. Labels are valid because # we already checked its name, so there can't be an error here |