mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-13 16:45:18 +08:00
Merge pull request #4624 from okriuchykhin/ok_SCI_7457
Fix protocol owner re-assignment when removing a user from a team [SCI-7457]
This commit is contained in:
commit
d9897d6e7c
1 changed files with 2 additions and 0 deletions
|
@ -196,6 +196,8 @@ module Users
|
|||
protocol.archived_by = new_owner unless protocol.archived_by.nil?
|
||||
protocol.restored_by = new_owner unless protocol.restored_by.nil?
|
||||
protocol.save!
|
||||
protocol.user_assignments.find_by(user: new_owner)&.destroy!
|
||||
protocol.user_assignments.create!(user: new_owner, user_role: UserRole.find_predefined_owner_role)
|
||||
end
|
||||
|
||||
# Make new owner author of all inventory items that were added
|
||||
|
|
Loading…
Add table
Reference in a new issue