diff --git a/app/models/deleted_dossier.rb b/app/models/deleted_dossier.rb index 96a78acec..687ec9458 100644 --- a/app/models/deleted_dossier.rb +++ b/app/models/deleted_dossier.rb @@ -47,4 +47,8 @@ class DeletedDossier < ApplicationRecord def procedure_removed? reason == self.class.reasons.fetch(:procedure_removed) end + + def user_locale + User.find_by(id: user_id)&.locale || I18n.default_locale + end end diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 3a1958cb3..e02866a3a 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -921,6 +921,10 @@ class Dossier < ApplicationRecord update_column(:api_entreprise_job_exceptions, exceptions) end + def user_locale + user&.locale || I18n.default_locale + end + private def defaut_groupe_instructeur?