Catching case for empty dossiers, cannot download them while locked on procedure

This commit is contained in:
JC 2017-01-03 15:15:20 +01:00
parent e7ef58dc9a
commit 2670a9db0e

View file

@ -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|