Merge pull request #4937 from tchak/do-not-delete-users-with-hidden-dossiers

User should not be deleted if they have hidden dossiers with state_instruction_commencee
This commit is contained in:
Paul Chavard 2020-03-25 19:02:13 +01:00 committed by GitHub
commit d9145545ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)