Merge pull request #3433 from artoscinote/ma_SCI_5607

Also send notification to the user that was unassigned from task [SCI-5607]
This commit is contained in:
artoscinote 2021-07-20 09:41:46 +02:00 committed by GitHub
commit 3a281ce9dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,6 +38,11 @@ module GenerateNotificationModel
users = subject.project.users
when MyModule
users = subject.users
# Also send to the user that was unassigned,
# and is therefore no longer present on the module.
if type_of == 'unassign_user_from_module'
users += User.where(id: values.dig('message_items', 'user_target', 'id'))
end
when Protocol
users = subject.in_repository? ? [] : subject.my_module.users
when Result