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:
commit
7932be7d96
2 changed files with 5 additions and 4 deletions
|
@ -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 })
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue