mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-25 01:03:18 +08:00
Merge pull request #5248 from artoscinote/ma_SCI_8259
Properly copy visibility and public assignments when cloning protocol [SCI-8259]
This commit is contained in:
commit
ed9f3d49d4
1 changed files with 5 additions and 1 deletions
|
@ -594,7 +594,9 @@ class Protocol < ApplicationRecord
|
|||
last_modified_by: current_user,
|
||||
team: team,
|
||||
protocol_type: :in_repository_draft,
|
||||
skip_user_assignments: true
|
||||
skip_user_assignments: true,
|
||||
visibility: visibility,
|
||||
default_public_user_role_id: default_public_user_role_id
|
||||
)
|
||||
|
||||
cloned = deep_clone(clone, current_user)
|
||||
|
@ -693,6 +695,8 @@ class Protocol < ApplicationRecord
|
|||
end
|
||||
|
||||
def update_automatic_user_assignments
|
||||
return if skip_user_assignments
|
||||
|
||||
case visibility
|
||||
when 'visible'
|
||||
create_or_update_public_user_assignments!(added_by)
|
||||
|
|
Loading…
Reference in a new issue