django-cast icon indicating copy to clipboard operation
django-cast copied to clipboard

Image is Missing When Using Inline Upload

Open ephes opened this issue 1 year ago • 0 comments

When an image is uploaded through the inline upload form when adding an image in the Wagtail editor, it is missing from the repository on rendering the draft.

    @staticmethod
    def get_image_and_renditions(image_id: int, context: dict) -> tuple[Image, dict[str, Rendition]]:
        repository: HasImagesAndRenditions = context["repository"]
        image = repository.image_by_id[image_id]  # error
        image_renditions = repository.renditions_for_posts.get(image.pk, [])
        fetched_renditions = {r.filter_spec: r for r in image_renditions}
        return image, fetched_renditions

ephes avatar Dec 22 '24 09:12 ephes