Skip to content

Commit

Permalink
chore: remove uninterlacing from web machines
Browse files Browse the repository at this point in the history
  • Loading branch information
E-L-T committed Aug 27, 2024
1 parent ae5a06f commit dedb772
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

module Administrateurs
class AttestationTemplatesController < AdministrateurController
include UninterlacePngConcern

before_action :retrieve_procedure
before_action :preload_revisions

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
module Instructeurs
class GroupeInstructeursController < InstructeurController
include EmailSanitizableConcern
include UninterlacePngConcern
include GroupeInstructeursSignatureConcern

before_action :ensure_allowed!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dedb772

Please sign in to comment.