From be0c0311c5a9407367784901b9b80984ed282f11 Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Tue, 12 Mar 2024 15:39:29 +0100 Subject: [PATCH] use export template for admin archives --- app/controllers/administrateurs/exports_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/administrateurs/exports_controller.rb b/app/controllers/administrateurs/exports_controller.rb index 6e1d55305..c7cd0a751 100644 --- a/app/controllers/administrateurs/exports_controller.rb +++ b/app/controllers/administrateurs/exports_controller.rb @@ -34,7 +34,11 @@ module Administrateurs private def export_format - @export_format ||= params[:export_format] + @export_format ||= params[:export_format].presence || export_template&.kind + end + + def export_template + @export_template ||= ExportTemplate.find(params[:export_template_id]) if params[:export_template_id].present? end def export_options