User should not be deleted if they have hidden dossiers with state_instruction_commencee

fix #4933
This commit is contained in:
Paul Chavard 2020-03-24 15:56:07 +01:00
parent ed0441176b
commit 08a5dd6a27

View file

@ -111,7 +111,7 @@ class User < ApplicationRecord
end
def can_be_deleted?
administrateur.nil? && instructeur.nil? && dossiers.state_instruction_commencee.empty?
administrateur.nil? && instructeur.nil? && dossiers.with_discarded.state_instruction_commencee.empty?
end
def delete_and_keep_track_dossiers(administration)