From dedb772550f33a9217126f136b8280b189090acf Mon Sep 17 00:00:00 2001 From: Eric Leroy-Terquem Date: Wed, 24 Jul 2024 11:10:24 +0200 Subject: [PATCH] chore: remove uninterlacing from web machines --- .../attestation_template_v2s_controller.rb | 13 ------------- .../attestation_templates_controller.rb | 12 ------------ .../groupe_instructeurs_controller.rb | 1 - .../groupe_instructeurs_signature_concern.rb | 4 +--- .../instructeurs/groupe_instructeurs_controller.rb | 1 - .../attestation_templates_controller_spec.rb | 2 -- 6 files changed, 1 insertion(+), 32 deletions(-) diff --git a/app/controllers/administrateurs/attestation_template_v2s_controller.rb b/app/controllers/administrateurs/attestation_template_v2s_controller.rb index ce926e84bff..e4419838087 100644 --- a/app/controllers/administrateurs/attestation_template_v2s_controller.rb +++ b/app/controllers/administrateurs/attestation_template_v2s_controller.rb @@ -2,8 +2,6 @@ module Administrateurs class AttestationTemplateV2sController < AdministrateurController - include UninterlacePngConcern - before_action :retrieve_procedure before_action :ensure_feature_active before_action :retrieve_attestation_template @@ -74,17 +72,6 @@ def update @attestation_template.procedure = @procedure end - logo_file = attestation_params.delete(:logo) - signature_file = attestation_params.delete(:signature) - - if logo_file - attestation_params[:logo] = uninterlace_png(logo_file) - end - - if signature_file - attestation_params[:signature] = uninterlace_png(signature_file) - end - @attestation_template.assign_attributes(attestation_params) if @attestation_template.invalid? diff --git a/app/controllers/administrateurs/attestation_templates_controller.rb b/app/controllers/administrateurs/attestation_templates_controller.rb index d703b99b26c..96f611f54d7 100644 --- a/app/controllers/administrateurs/attestation_templates_controller.rb +++ b/app/controllers/administrateurs/attestation_templates_controller.rb @@ -2,8 +2,6 @@ module Administrateurs class AttestationTemplatesController < AdministrateurController - include UninterlacePngConcern - before_action :retrieve_procedure before_action :preload_revisions @@ -63,16 +61,6 @@ def activated_attestation_params if @activated_attestation_params.nil? @activated_attestation_params = params.require(:attestation_template) .permit(:title, :body, :footer, :activated, :logo, :signature) - - logo_file = params['attestation_template'].delete('logo') - signature_file = params['attestation_template'].delete('signature') - - if logo_file.present? - @activated_attestation_params[:logo] = uninterlace_png(logo_file) - end - if signature_file.present? - @activated_attestation_params[:signature] = uninterlace_png(signature_file) - end end @activated_attestation_params diff --git a/app/controllers/administrateurs/groupe_instructeurs_controller.rb b/app/controllers/administrateurs/groupe_instructeurs_controller.rb index 61225de7725..b0fd71ff58e 100644 --- a/app/controllers/administrateurs/groupe_instructeurs_controller.rb +++ b/app/controllers/administrateurs/groupe_instructeurs_controller.rb @@ -5,7 +5,6 @@ class GroupeInstructeursController < AdministrateurController include ActiveSupport::NumberHelper include EmailSanitizableConcern include Logic - include UninterlacePngConcern include GroupeInstructeursSignatureConcern before_action :ensure_not_super_admin!, only: [:add_instructeur] diff --git a/app/controllers/concerns/groupe_instructeurs_signature_concern.rb b/app/controllers/concerns/groupe_instructeurs_signature_concern.rb index e7c843a4a63..4e2fee3c07e 100644 --- a/app/controllers/concerns/groupe_instructeurs_signature_concern.rb +++ b/app/controllers/concerns/groupe_instructeurs_signature_concern.rb @@ -19,9 +19,7 @@ def add_signature flash[:alert] = "Aucun fichier joint pour le tampon de l'attestation" render :show else - signature = uninterlace_png(signature_file) - - if @groupe_instructeur.signature.attach(signature) + if @groupe_instructeur.signature.attach(signature_file) handle_redirect :success else handle_redirect :alert diff --git a/app/controllers/instructeurs/groupe_instructeurs_controller.rb b/app/controllers/instructeurs/groupe_instructeurs_controller.rb index 7fbf5dbd2f6..0c5a0671def 100644 --- a/app/controllers/instructeurs/groupe_instructeurs_controller.rb +++ b/app/controllers/instructeurs/groupe_instructeurs_controller.rb @@ -3,7 +3,6 @@ module Instructeurs class GroupeInstructeursController < InstructeurController include EmailSanitizableConcern - include UninterlacePngConcern include GroupeInstructeursSignatureConcern before_action :ensure_allowed! diff --git a/spec/controllers/administrateurs/attestation_templates_controller_spec.rb b/spec/controllers/administrateurs/attestation_templates_controller_spec.rb index f38e2fd0690..1f6ef9243e7 100644 --- a/spec/controllers/administrateurs/attestation_templates_controller_spec.rb +++ b/spec/controllers/administrateurs/attestation_templates_controller_spec.rb @@ -8,8 +8,6 @@ let(:logo2) { fixture_file_upload('spec/fixtures/files/white.png', 'image/png') } let(:signature) { fixture_file_upload('spec/fixtures/files/black.png', 'image/png') } let(:signature2) { fixture_file_upload('spec/fixtures/files/black.png', 'image/png') } - let(:interlaced_logo) { fixture_file_upload('spec/fixtures/files/interlaced-black.png', 'image/png') } - let(:uninterlaced_logo) { fixture_file_upload('spec/fixtures/files/uninterlaced-black.png', 'image/png') } let(:invalid_logo) { fixture_file_upload('spec/fixtures/files/invalid_file_format.json', 'application/json') } before do