diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-08-16 17:49:53 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-08-16 17:49:53 -0500 |
commit | e07c27fee427195d8d89f6278d0fc12dfeec3588 (patch) | |
tree | c4676e5e953aecef8bf2bb715619027cd556c9cc /app/services/issues | |
parent | 029b7d2e9266246feff2f165a10b16be1d7fe88e (diff) | |
parent | 415159c28da1aec00bb383d46aad67a9de75faae (diff) | |
download | gitlab-ce-e07c27fee427195d8d89f6278d0fc12dfeec3588.tar.gz |
Merge branch 'master' into 4273-slash-commands
# Conflicts:
# app/services/issues/create_service.rb
Diffstat (limited to 'app/services/issues')
-rw-r--r-- | app/services/issues/create_service.rb | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/app/services/issues/create_service.rb b/app/services/issues/create_service.rb index 1b03d7f4c05..8314c9971ff 100644 --- a/app/services/issues/create_service.rb +++ b/app/services/issues/create_service.rb @@ -1,25 +1,30 @@ module Issues class CreateService < Issues::BaseService def execute - issue = project.issues.new - request = params.delete(:request) - api = params.delete(:api) + @request = params.delete(:request) + @api = params.delete(:api) - issue.spam = spam_check_service.execute(request, api) + @issue = project.issues.new + @issue.spam = spam_service.check(@api) - create(issue) + create(@issue) end def handle_creation(issuable) event_service.open_issue(issuable, current_user) notification_service.new_issue(issuable, current_user) todo_service.new_issue(issuable, current_user) + user_agent_detail_service.create end private - def spam_check_service - SpamCheckService.new(project, current_user, params) + def spam_service + SpamService.new(@issue, @request) + end + + def user_agent_detail_service + UserAgentDetailService.new(@issue, @request) end end end |