diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-07-26 15:19:37 +0300 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-07-29 14:54:45 +0300 |
commit | 76e9b68439510af5c783a81b93944f1c8d96d150 (patch) | |
tree | 62f4dde6c0caa56aa9ebbbdd31df9a215767dc87 /lib/api | |
parent | 84cd2120952e7ee4095cb4b5d7c959f2c11610c5 (diff) |
Incorporate feedback
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/environments.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/api/environments.rb b/lib/api/environments.rb index 66a047f72fc..532baec42c7 100644 --- a/lib/api/environments.rb +++ b/lib/api/environments.rb @@ -30,9 +30,6 @@ module API required_attributes! [:name] attrs = attributes_for_keys [:name, :external_url] - environment = user_project.environments.find_by(name: attrs[:name]) - - conflict!('Environment already exists') if environment environment = user_project.environments.create(attrs) @@ -52,7 +49,7 @@ module API # Example Request: # DELETE /projects/:id/environments/:environment_id delete ':id/environments/:environment_id' do - authorize! :admin_environment, user_project + authorize! :update_environment, user_project environment = user_project.environments.find(params[:environment_id]) |