DEV: Remove fabrication hack for staff (#19528)

This commit is contained in:
Bianca Nenciu 2022-12-21 14:02:40 +02:00 committed by GitHub
parent 8820e9418a
commit 269b6177c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -54,8 +54,7 @@ Fabricator(:moderator, from: :user) do
after_create do |user|
user.group_users << Fabricate(:group_user, user: user, group: Group[:moderators])
# HACK: Some plugins add the user to staff group already which breaks because of duplication
user.group_users << Fabricate(:group_user, user: user, group: Group[:staff]) if group_users.none? { |gu| gu.group == Group[:staff] }
user.group_users << Fabricate(:group_user, user: user, group: Group[:staff])
end
end
@ -67,8 +66,7 @@ Fabricator(:admin, from: :user) do
after_create do |user|
user.group_users << Fabricate(:group_user, user: user, group: Group[:admins])
# HACK: Some plugins add the user to staff group already which breaks because of duplication
user.group_users << Fabricate(:group_user, user: user, group: Group[:staff]) if group_users.none? { |gu| gu.group == Group[:staff] }
user.group_users << Fabricate(:group_user, user: user, group: Group[:staff])
end
end