mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 09:42:46 +08:00
Merge pull request #4521 from okriuchykhin/ok_SCI_7325
Fix protocol import in templates [SCI-7325]
This commit is contained in:
commit
c725e1f100
3 changed files with 4 additions and 2 deletions
|
@ -48,7 +48,7 @@ module Assignable
|
|||
return if skip_user_assignments
|
||||
|
||||
role = if is_a?(Project) || is_a?(Team)
|
||||
UserRole.find_by(name: I18n.t('user_roles.predefined.owner'))
|
||||
UserRole.find_predefined_owner_role
|
||||
else
|
||||
permission_parent.user_assignments.find_by(user: created_by).user_role
|
||||
end
|
||||
|
|
|
@ -8,8 +8,9 @@ class Protocol < ApplicationRecord
|
|||
include PermissionCheckableModel
|
||||
include TinyMceImages
|
||||
|
||||
after_save :update_linked_children
|
||||
after_destroy :decrement_linked_children
|
||||
after_save :update_linked_children
|
||||
skip_callback :create, :after, :create_users_assignments, if: -> { in_module? }
|
||||
|
||||
enum protocol_type: {
|
||||
unlinked: 0,
|
||||
|
|
|
@ -787,6 +787,7 @@ class TeamImporter
|
|||
protocol.archived_by_id = find_user(protocol.archived_by_id)
|
||||
protocol.restored_by_id = find_user(protocol.restored_by_id)
|
||||
protocol.my_module = my_module unless protocol.my_module_id.nil?
|
||||
protocol.skip_user_assignments = true
|
||||
protocol.parent_id = @protocol_mappings[protocol.parent_id] unless protocol.parent_id.nil?
|
||||
protocol.save!
|
||||
@protocol_counter += 1
|
||||
|
|
Loading…
Reference in a new issue