Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/environments.rb')
-rw-r--r--lib/api/environments.rb5
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])