diff options
author | Douwe Maan <douwe@selenight.nl> | 2018-05-04 12:40:37 +0200 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2018-05-04 12:41:53 +0200 |
commit | 739029bb0f03ff2bf70d67b3d2a09ddd196143a6 (patch) | |
tree | 1cbb3b8e14dd16c1a66d727e73ed9b0177fce0cd /lib | |
parent | 4cfa8168a204b42d2982a6817c9ba6c960ae62b3 (diff) | |
download | gitlab-ce-739029bb0f03ff2bf70d67b3d2a09ddd196143a6.tar.gz |
Fix API to remove deploy key from project instead of deleting it entirely
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/deploy_keys.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/deploy_keys.rb b/lib/api/deploy_keys.rb index 70d43ac1d79..b7aadc27e71 100644 --- a/lib/api/deploy_keys.rb +++ b/lib/api/deploy_keys.rb @@ -148,10 +148,10 @@ module API requires :key_id, type: Integer, desc: 'The ID of the deploy key' end delete ":id/deploy_keys/:key_id" do - key = user_project.deploy_keys.find(params[:key_id]) - not_found!('Deploy Key') unless key + deploy_key_project = user_project.deploy_keys_projects.find_by(deploy_key_id: params[:key_id]) + not_found!('Deploy Key') unless deploy_key_project - destroy_conditionally!(key) + destroy_conditionally!(deploy_key_project) end end end |