diff --git a/app/controllers/instructeurs/dossiers_controller.rb b/app/controllers/instructeurs/dossiers_controller.rb index 8c5aab441..91b56f490 100644 --- a/app/controllers/instructeurs/dossiers_controller.rb +++ b/app/controllers/instructeurs/dossiers_controller.rb @@ -271,14 +271,14 @@ module Instructeurs end def dossier - @dossier ||= dossier_scope.find(params[:dossier_id]) + @dossier ||= DossierPreloader.load_one(dossier_scope.find(params[:dossier_id])) end def dossier_with_champs - @dossier ||= dossier_scope + @dossier ||= DossierPreloader.load_one(dossier_scope .with_champs .with_annotations - .find(params[:dossier_id]) + .find(params[:dossier_id])) end def commentaire_params diff --git a/app/views/shared/dossiers/_demande.html.haml b/app/views/shared/dossiers/_demande.html.haml index e93a58174..3cf1acd66 100644 --- a/app/views/shared/dossiers/_demande.html.haml +++ b/app/views/shared/dossiers/_demande.html.haml @@ -33,7 +33,7 @@ = link_to t('views.shared.dossiers.demande.edit_identity'), identite_dossier_path(dossier), class: 'fr-btn fr-btn--tertiary' %h2.fr-h6= t('views.shared.dossiers.demande.form') - - champs = dossier.champs_public.includes(:type_de_champ) + - champs = dossier.champs_public - if champs.any? || dossier.procedure.routing_enabled? .card = render partial: "shared/dossiers/champs", locals: { champs: champs, dossier: dossier, demande_seen_at: demande_seen_at, profile: profile }