Do not allow to upload SVG logos with embedded raster images in them

Those are for example png or jpg images. They do not render properly.
This commit is contained in:
Pea Tyczynska
2020-03-04 14:25:14 +00:00
parent beb3c5b00d
commit 44519fcf8e
3 changed files with 46 additions and 2 deletions

View File

@@ -42,6 +42,7 @@ from app.main.validators import (
LettersNumbersAndFullStopsOnly,
MustContainAlphanumericCharacters,
NoCommasInPlaceHolders,
NoEmbeddedImagesInSVG,
OnlySMSCharacters,
ValidEmail,
ValidGovEmail,
@@ -1133,7 +1134,8 @@ class SVGFileUpload(StripWhitespaceForm):
'Upload an SVG logo',
validators=[
FileAllowed(['svg'], 'SVG Images only!'),
DataRequired(message="You need to upload a file to submit")
DataRequired(message="You need to upload a file to submit"),
NoEmbeddedImagesInSVG()
]
)