Merge pull request #5827 from betagouv/fix_missing_valid_content_type

ajoute les image comme content type valide pour les notices and les deliberations
This commit is contained in:
LeSim 2021-01-04 15:27:04 +01:00 committed by GitHub
commit e12cb64954
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -191,20 +191,26 @@ class Procedure < ApplicationRecord
validates :notice, content_type: [
"application/msword",
"application/pdf",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.ms-powerpoint",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
"application/vnd.oasis.opendocument.text",
"application/vnd.oasis.opendocument.presentation",
"application/vnd.oasis.opendocument.text",
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"image/jpeg",
"image/jpg",
"image/png",
"text/plain"
], size: { less_than: 20.megabytes }
validates :deliberation, content_type: [
"application/msword",
"application/pdf",
"application/vnd.oasis.opendocument.text",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"text/plain",
"application/vnd.oasis.opendocument.text"
"image/jpeg",
"image/jpg",
"image/png",
"text/plain"
], size: { less_than: 20.megabytes }
validates :logo, content_type: ['image/png', 'image/jpg', 'image/jpeg'], size: { less_than: 5.megabytes }