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