Merge pull request #5043 from aignatov-bio/ai-sci-8019-fix-user-invitation

Fix protocol public assignments [SCI-8019]
This commit is contained in:
aignatov-bio 2023-02-28 15:18:12 +01:00 committed by GitHub
commit 7c51cba245
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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