mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 21:49:37 -04:00
Merge pull request #3349 from alphagov/fix-logo-upload
Fix logo upload - we need to rewind the bytestream after we read it
This commit is contained in:
@@ -86,7 +86,9 @@ class NoEmbeddedImagesInSVG:
|
|||||||
self.message = message
|
self.message = message
|
||||||
|
|
||||||
def __call__(self, form, field):
|
def __call__(self, form, field):
|
||||||
if '<image' in field.data.stream.read().decode("utf-8"):
|
is_image_embedded = '<image' in field.data.stream.read().decode("utf-8")
|
||||||
|
field.data.stream.seek(0)
|
||||||
|
if is_image_embedded:
|
||||||
raise ValidationError(self.message)
|
raise ValidationError(self.message)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user