diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-01 12:08:00 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-01 12:08:00 +0000 |
commit | 1a0d6dbdc2ac3047f4953a359ef27ba6e26074ae (patch) | |
tree | ddb78a8a0d1350dc767f049a21e0f7d37edaa82c /app/services/groups | |
parent | b11f7057d067885619ee3e513751f180b2e8ad85 (diff) | |
download | gitlab-ce-1a0d6dbdc2ac3047f4953a359ef27ba6e26074ae.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/groups')
-rw-r--r-- | app/services/groups/deploy_tokens/create_service.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/services/groups/deploy_tokens/create_service.rb b/app/services/groups/deploy_tokens/create_service.rb index 8c42b56ebb0..d747dabcd3c 100644 --- a/app/services/groups/deploy_tokens/create_service.rb +++ b/app/services/groups/deploy_tokens/create_service.rb @@ -6,7 +6,13 @@ module Groups include DeployTokenMethods def execute - create_deploy_token_for(@group, params) + deploy_token = create_deploy_token_for(@group, params) + + if deploy_token.persisted? + success(deploy_token: deploy_token, http_status: :ok) + else + error(deploy_token.errors.full_messages.to_sentence, :bad_request) + end end end end |