From b93ba5510e79da97c2ddb47e68f210684785f481 Mon Sep 17 00:00:00 2001 From: Paul Arterburn Date: Mon, 8 Jan 2024 12:00:38 -0700 Subject: [PATCH] Fix 500 --- app/lib/email_processor.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/lib/email_processor.rb b/app/lib/email_processor.rb index 21f89db4..102fb8a0 100644 --- a/app/lib/email_processor.rb +++ b/app/lib/email_processor.rb @@ -56,16 +56,16 @@ def process p file_size p attachment.content_type p attachment&.original_filename - p (attachment.content_type == "application/octet-stream" || attachment.content_type =~ /^image\/(png|jpe?g|webp|gif|heic|heif)$/i || attachment&.original_filename.to_s =~ /^(.+\.(heic|heif))$/i || attachment&.filename.to_s =~ /^(.+\.(heic|heif))$/i) && file_size > 20000 + p (attachment.content_type == "application/octet-stream" || attachment.content_type =~ /^image\/(png|jpe?g|webp|gif|heic|heif)$/i || attachment&.original_filename.to_s =~ /^(.+\.(heic|heif))$/i) && file_size > 20000 p "*" * 100 end # skip signature images - next if @user.id == 293 && (attachment&.original_filename.to_s == "cropped-IMG-0719-300x86.jpeg" || attachment&.filename.to_s == "cropped-IMG-0719-300x86.jpeg") - next if @user.id == 10836 && (attachment&.original_filename.to_s == "B_Logo.png" || attachment&.filename.to_s == "B_Logo.png") - next if @user.id == 2541 && (attachment&.original_filename.to_s == "image001.jpg" || attachment&.filename.to_s == "image001.jpg") + next if @user.id == 293 && attachment&.original_filename.to_s == "cropped-IMG-0719-300x86.jpeg" + next if @user.id == 10836 && attachment&.original_filename.to_s == "B_Logo.png" + next if @user.id == 2541 && attachment&.original_filename.to_s == "image001.jpg" - if (attachment.content_type == "application/octet-stream" || attachment.content_type =~ /^image\/(png|jpe?g|webp|gif|heic|heif)$/i || attachment&.original_filename.to_s =~ /^(.+\.(heic|heif))$/i || attachment&.filename.to_s =~ /^(.+\.(heic|heif))$/i) && file_size > 20000 + if (attachment.content_type == "application/octet-stream" || attachment.content_type =~ /^image\/(png|jpe?g|webp|gif|heic|heif)$/i || attachment&.original_filename.to_s =~ /^(.+\.(heic|heif))$/i) && file_size > 20000 valid_attachments << attachment end end