Fix protocol public assignments [SCI-8019]

This commit is contained in:
Anton 2023-02-28 15:15:55 +01:00
parent fab7d9c3d6
commit 6c7a0d85c2
2 changed files with 4 additions and 4 deletions

View file

@ -99,7 +99,7 @@ module AccessPermissions
@protocol.assign_attributes(permitted_default_public_user_role_params)
@protocol.save!
UserAssignments::ProjectGroupAssignmentJob.perform_later(current_team, @project, current_user)
UserAssignments::ProtocolGroupAssignmentJob.perform_later(current_team, @protocol, current_user)
end
end

View file

@ -38,9 +38,9 @@ class Team < ApplicationRecord
has_many :protocols, inverse_of: :team, dependent: :destroy
has_many :repository_protocols,
(lambda do
where(protocol_type: [Protocol.protocol_types[:in_repository_public],
Protocol.protocol_types[:in_repository_private],
Protocol.protocol_types[:in_repository_archived]])
where(protocol_type: %i(in_repository_published_original
in_repository_draft
in_repository_published_version))
end),
class_name: 'Protocol'
has_many :protocol_keywords, inverse_of: :team, dependent: :destroy