Adds alt text to status images

This commit is contained in:
Mouse Reeve
2020-11-24 11:44:13 -08:00
parent 45a0bd79fd
commit ff5a0f7bc2
5 changed files with 7 additions and 4 deletions

View File

@ -227,7 +227,8 @@ def image_attachments_formatter(images_json):
''' deserialize a list of images '''
attachments = []
for image in images_json:
attachment = models.Attachment()
caption = image.get('name')
attachment = models.Attachment(caption=caption)
image_field = image_formatter(image)
attachment.image.save(*image_field, save=False)
attachments.append(attachment)