Commit 58971d16 authored by Daniel Gerhardt's avatar Daniel Gerhardt

Fix before_filter for group path

parent d4d35afd
...@@ -24,7 +24,7 @@ class GroupsController < Groups::ApplicationController ...@@ -24,7 +24,7 @@ class GroupsController < Groups::ApplicationController
before_action :user_actions, only: [:show] before_action :user_actions, only: [:show]
before_filter :validate_name, only: [:create, :update] before_filter :validate_name, only: [:create, :update, :transfer]
skip_cross_project_access_check :index, :new, :create, :edit, :update, skip_cross_project_access_check :index, :new, :create, :edit, :update,
...@@ -198,7 +198,7 @@ class GroupsController < Groups::ApplicationController ...@@ -198,7 +198,7 @@ class GroupsController < Groups::ApplicationController
def validate_name def validate_name
group = Group.new(group_params) group = Group.new(group_params)
unless group.path.empty? || group.path.length > 4 || current_user.admin? unless !group.path || group.path.empty? || group.path.length > 4 || current_user.admin?
flash.now[:alert] = 'Path must have at least a length of 5.' flash.now[:alert] = 'Path must have at least a length of 5.'
if action_name == 'update' if action_name == 'update'
render action: 'edit' render action: 'edit'
......
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