Use service_url instead of blob_url on secure attachments
This commit is contained in:
parent
cccb04d725
commit
785a09b326
4 changed files with 4 additions and 4 deletions
|
@ -15,7 +15,7 @@ module Instructeurs
|
||||||
|
|
||||||
def attestation
|
def attestation
|
||||||
if dossier.attestation.pdf.attached?
|
if dossier.attestation.pdf.attached?
|
||||||
redirect_to url_for(dossier.attestation.pdf)
|
redirect_to dossier.attestation.pdf.service_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ module Users
|
||||||
|
|
||||||
def attestation
|
def attestation
|
||||||
if dossier.attestation&.pdf&.attached?
|
if dossier.attestation&.pdf&.attached?
|
||||||
redirect_to url_for(dossier.attestation.pdf)
|
redirect_to dossier.attestation.pdf.service_url
|
||||||
else
|
else
|
||||||
flash.notice = "L'attestation n'est plus disponible sur ce dossier."
|
flash.notice = "L'attestation n'est plus disponible sur ce dossier."
|
||||||
redirect_to dossier_path(dossier)
|
redirect_to dossier_path(dossier)
|
||||||
|
|
|
@ -7,7 +7,7 @@ module Types
|
||||||
field :content_type, String, null: false
|
field :content_type, String, null: false
|
||||||
|
|
||||||
def url
|
def url
|
||||||
Rails.application.routes.url_helpers.url_for(object)
|
object.service_url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -48,7 +48,7 @@ class Champs::PieceJustificativeChamp < Champ
|
||||||
|
|
||||||
def for_api
|
def for_api
|
||||||
if piece_justificative_file.attached? && (piece_justificative_file.virus_scanner.safe? || piece_justificative_file.virus_scanner.pending?)
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue