mirror of
https://github.com/redmine/redmine.git
synced 2024-08-27 17:54:48 +02:00
Prevents validation error when adding a user to a group (#6457).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4437 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
620c48fbbb
commit
d24e66370b
@ -31,6 +31,7 @@ class Group < Principal
|
||||
|
||||
def user_added(user)
|
||||
members.each do |member|
|
||||
next if member.project.nil?
|
||||
user_member = Member.find_by_project_id_and_user_id(member.project_id, user.id) || Member.new(:project_id => member.project_id, :user_id => user.id)
|
||||
member.member_roles.each do |member_role|
|
||||
user_member.member_roles << MemberRole.new(:role => member_role.role, :inherited_from => member_role.id)
|
||||
|
Loading…
Reference in New Issue
Block a user