mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Merge pull request #6750 from G-Chubinidze/gc_SCI_9788
Redundant notifications [SCI-9788]
This commit is contained in:
commit
31e55488a7
2 changed files with 3 additions and 1 deletions
|
@ -531,7 +531,7 @@ class MyModulesController < ApplicationController
|
|||
end
|
||||
|
||||
def log_user_designation_activity
|
||||
users = User.where(id: params[:my_module][:user_ids])
|
||||
users = User.where.not(id: current_user.id).where(id: params[:my_module][:user_ids])
|
||||
|
||||
users.each do |user|
|
||||
log_activity(:designate_user_to_my_module, @my_module, { user_target: user.id })
|
||||
|
|
|
@ -9,6 +9,8 @@ class UserMyModule < ApplicationRecord
|
|||
belongs_to :my_module, inverse_of: :user_my_modules, touch: true
|
||||
|
||||
def log_activity(type_of, current_user)
|
||||
return if current_user.id == user.id
|
||||
|
||||
Activities::CreateActivityService
|
||||
.call(activity_type: type_of,
|
||||
owner: current_user,
|
||||
|
|
Loading…
Reference in a new issue