Use service_url instead of blob_url on secure attachments

This commit is contained in:
Paul Chavard 2019-12-19 18:15:37 +01:00
parent cccb04d725
commit 785a09b326
4 changed files with 4 additions and 4 deletions

View file

@ -15,7 +15,7 @@ module Instructeurs
def attestation
if dossier.attestation.pdf.attached?
redirect_to url_for(dossier.attestation.pdf)
redirect_to dossier.attestation.pdf.service_url
end
end

View file

@ -49,7 +49,7 @@ module Users
def attestation
if dossier.attestation&.pdf&.attached?
redirect_to url_for(dossier.attestation.pdf)
redirect_to dossier.attestation.pdf.service_url
else
flash.notice = "L'attestation n'est plus disponible sur ce dossier."
redirect_to dossier_path(dossier)

View file

@ -7,7 +7,7 @@ module Types
field :content_type, String, null: false
def url
Rails.application.routes.url_helpers.url_for(object)
object.service_url
end
end
end

View file

@ -48,7 +48,7 @@ class Champs::PieceJustificativeChamp < Champ
def for_api
if piece_justificative_file.attached? && (piece_justificative_file.virus_scanner.safe? || piece_justificative_file.virus_scanner.pending?)
Rails.application.routes.url_helpers.url_for(piece_justificative_file)
piece_justificative_file.service_url
end
end
end