diff --git a/app/models/dossier.rb b/app/models/dossier.rb index b3241ba37..b1898d2e2 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -701,7 +701,8 @@ class Dossier < ApplicationRecord end def attachments_downloadable? - !PiecesJustificativesService.liste_pieces_justificatives(self).empty? && PiecesJustificativesService.pieces_justificatives_total_size(self) < Dossier::TAILLE_MAX_ZIP + PiecesJustificativesService.liste_pieces_justificatives(self).present? \ + && PiecesJustificativesService.pieces_justificatives_total_size(self) < Dossier::TAILLE_MAX_ZIP end def linked_dossiers_for(instructeur) diff --git a/app/views/instructeurs/dossiers/_header_actions.html.haml b/app/views/instructeurs/dossiers/_header_actions.html.haml index 62b2e0add..e83bff6ff 100644 --- a/app/views/instructeurs/dossiers/_header_actions.html.haml +++ b/app/views/instructeurs/dossiers/_header_actions.html.haml @@ -12,7 +12,7 @@ %li = link_to "Export GeoJSON", geo_data_instructeur_dossier_path(dossier.procedure, dossier), target: "_blank", rel: "noopener", class: "menu-item menu-link" -- if !PiecesJustificativesService.liste_pieces_justificatives(dossier).empty? +- if PiecesJustificativesService.liste_pieces_justificatives(dossier).present? %span.dropdown.print-menu-opener %button.button.dropdown-button.icon-only %span.icon.attached