Merge pull request #11179 from mfo/US/fix-attestation-v2

correctif: ETQ DS, lorsque je génère une attestation v2 suite a l'acceptation d'un dossier, je m'assure de rendre la bonne signature
This commit is contained in:
mfo 2025-01-03 15:01:46 +00:00 committed by GitHub
commit 7932be7d96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -213,13 +213,15 @@ class AttestationTemplate < ApplicationRecord
end
def build_v2_pdf(dossier)
body = render_attributes_for(dossier:).fetch(:body)
attributes = render_attributes_for(dossier:)
body = attributes.fetch(:body)
signature = attributes.fetch(:signature)
html = ApplicationController.render(
template: '/administrateurs/attestation_template_v2s/show',
formats: [:html],
layout: 'attestation',
assigns: { attestation_template: self, body: body }
assigns: { attestation_template: self, body:, signature: }
)
WeasyprintService.generate_pdf(html, { procedure_id: procedure.id, dossier_id: dossier.id })

View file

@ -25,7 +25,6 @@
.main
= sanitize(@body, attributes: %w[class style], tags: Rails.configuration.action_view.sanitized_allowed_tags + %w[header])
- if @signature&.attached?
.signature
= image_tag(@signature)
= image_tag(Rails.application.routes.url_helpers.url_for(@signature))