From 3178690fc67dd8abde131f089225fc573cf79131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Tue, 18 Jun 2019 15:00:40 +0200 Subject: [PATCH] Approval workflow notifications are sent to locked users #1013 --- app/controllers/dmsf_workflows_controller.rb | 2 +- app/models/dmsf_mailer.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/dmsf_workflows_controller.rb b/app/controllers/dmsf_workflows_controller.rb index 7bb78cab..92407eaa 100644 --- a/app/controllers/dmsf_workflows_controller.rb +++ b/app/controllers/dmsf_workflows_controller.rb @@ -112,7 +112,7 @@ class DmsfWorkflowsController < ApplicationController else if action.action == DmsfWorkflowStepAction::ACTION_DELEGATE # Delegation - delegate = User.find_by(id: params[:step_action].to_i / 10) + delegate = User.active.find_by(id: params[:step_action].to_i / 10) if DmsfMailer.get_notify_users(@project, [revision.dmsf_file], true).include?(delegate) DmsfMailer.deliver_workflow_notification( [delegate], diff --git a/app/models/dmsf_mailer.rb b/app/models/dmsf_mailer.rb index 85fa720b..4da11fee 100644 --- a/app/models/dmsf_mailer.rb +++ b/app/models/dmsf_mailer.rb @@ -123,7 +123,7 @@ class DmsfMailer < Mailer notify_files = files.select { |file| file.notify? } return [] if notify_files.empty? end - notify_members = project.members.select do |notify_member| + notify_members = project.members.active.select do |notify_member| notify_user = notify_member.user if notify_user == User.current && notify_user.pref.no_self_notified false