summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-04-13 22:59:31 +0000
committerGo MAEDA <maeda@farend.jp>2023-04-13 22:59:31 +0000
commite16a11a22aad8a732d6637365ececfd4d8f5bc12 (patch)
treea85205aafa18c9c24ed6c4709b86865970ca2679 /app
parentd1e10ee1a9930eee1e4756f2d710c130bcccfa72 (diff)
downloadredmine-e16a11a22aad8a732d6637365ececfd4d8f5bc12.tar.gz
redmine-e16a11a22aad8a732d6637365ececfd4d8f5bc12.zip
Merged r22180 from trunk to 5.0-stable (#38443).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@22181 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/group.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index 92a378e6e..1cfc6b56c 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -80,6 +80,8 @@ class Group < Principal
def user_added(user)
members.preload(:member_roles).each do |member|
next if member.project_id.nil?
+ # skip if the group is a member without roles in the project
+ next if member.member_roles.empty?
user_member =
Member.find_or_initialize_by(:project_id => member.project_id, :user_id => user.id)