summaryrefslogtreecommitdiff
path: root/app/controllers/projects/environments_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/environments_controller.rb')
-rw-r--r--app/controllers/projects/environments_controller.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/projects/environments_controller.rb b/app/controllers/projects/environments_controller.rb
index cac0aa9d513..23dabd885c8 100644
--- a/app/controllers/projects/environments_controller.rb
+++ b/app/controllers/projects/environments_controller.rb
@@ -213,8 +213,14 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
end
+ def allowed_environment_attributes
+ attributes = [:external_url]
+ attributes << :name if action_name == "create"
+ attributes
+ end
+
def environment_params
- params.require(:environment).permit(:name, :external_url)
+ params.require(:environment).permit(allowed_environment_attributes)
end
def environment