Commit 541031a0 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Prevent group names of length < 5 when updating settings

This restriction does not apply to admins.
parent 23b57fdf
......@@ -18,7 +18,8 @@ class GroupsController < Groups::ApplicationController
before_action :user_actions, only: [:show, :subgroups]
before_filter :validate_name, only: :create
before_filter :validate_name, only: [:create, :update]
skip_cross_project_access_check :index, :new, :create, :edit, :update,
:destroy, :projects
......@@ -187,10 +188,15 @@ def user_actions
def validate_name
@group =
unless @group.path.empty? || @group.path.length > 4 || current_user.admin?
group =
unless group.path.empty? || group.path.length > 4 || current_user.admin?[:alert] = 'Path must have at least a length of 5.'
render action: "new"
if action_name == 'update'
render action: 'edit'
@group = group
render action: 'new'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment