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:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-05-29 16:35:05 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-05-29 16:35:05 +0300
commit394fe7614c3d8507b79ca41419f11bcde906ccae (patch)
treec6ea3084085d581edf8a2f9079850897e55741cc /app/controllers
parent907bbb2b05860be401c77b305721b35a2850ea71 (diff)
parent85de253ee10aa7821a212270a1940c6205533d38 (diff)
Merge branch 'leave-group' into 'master'
User should be able to leave group. If not - show him proper message Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> See merge request !743
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/groups/group_members_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/groups/group_members_controller.rb b/app/controllers/groups/group_members_controller.rb
index a11c554a2af..040255f08e6 100644
--- a/app/controllers/groups/group_members_controller.rb
+++ b/app/controllers/groups/group_members_controller.rb
@@ -66,7 +66,11 @@ class Groups::GroupMembersController < Groups::ApplicationController
@group_member.destroy
redirect_to(dashboard_groups_path, notice: "You left #{group.name} group.")
else
- return render_403
+ if @group.last_owner?(current_user)
+ redirect_to(dashboard_groups_path, alert: "You can not leave #{group.name} group because you're the last owner. Transfer or delete the group.")
+ else
+ return render_403
+ end
end
end