mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-13 06:54:20 -05: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
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user