From 2670a9db0e617894eac7df2bcae5ea545fdf43f8 Mon Sep 17 00:00:00 2001 From: JC Date: Tue, 3 Jan 2017 15:15:20 +0100 Subject: [PATCH] Catching case for empty dossiers, cannot download them while locked on procedure --- app/controllers/backoffice/dossiers_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/backoffice/dossiers_controller.rb b/app/controllers/backoffice/dossiers_controller.rb index ac58e36e5..89a3a63cc 100644 --- a/app/controllers/backoffice/dossiers_controller.rb +++ b/app/controllers/backoffice/dossiers_controller.rb @@ -41,7 +41,7 @@ class Backoffice::DossiersController < Backoffice::DossiersListController def download_dossiers_tps if procedure = Procedure.find_by(id: params[:procedure_id]) dossiers = dossiers_list_facade(param_liste).dossiers_to_display - respond_with Dossier.export_full_generation(dossiers, request.format) if dossiers + respond_with Dossier.export_full_generation(dossiers, request.format) if dossiers.empty? else dossiers = dossiers_list_facade(param_liste).dossiers_to_display respond_to do |format|