summaryrefslogtreecommitdiff
path: root/app/controllers/groups_controller.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-12-20 17:52:27 +0100
committerJames Lopez <james@jameslopez.es>2016-12-20 17:52:27 +0100
commitb82fdf6257255b720526ccef716759892e88de09 (patch)
tree52c4adbaa69a9e4b4174b6efc0f817ffda64d815 /app/controllers/groups_controller.rb
parentad1a1d976c877eca16858368db0c5b3ef800db8b (diff)
downloadgitlab-ce-b82fdf6257255b720526ccef716759892e88de09.tar.gz
Fix error 500 renaming group. Also added specs and changelog.
Diffstat (limited to 'app/controllers/groups_controller.rb')
-rw-r--r--app/controllers/groups_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index b83c3a872cf..5c7709ea013 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -82,7 +82,10 @@ class GroupsController < Groups::ApplicationController
if Groups::UpdateService.new(@group, current_user, group_params).execute
redirect_to edit_group_path(@group), notice: "Group '#{@group.name}' was successfully updated."
else
- render action: "edit"
+ error = group.errors.full_messages.first
+ alert_message = "Group '#{@group.name}' cannot be updated: " + error
+
+ redirect_to edit_group_path(@group.reload), alert: alert_message
end
end