Skip to content

Commit

Permalink
Ingest images
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmwangemi committed Jan 25, 2024
1 parent 9398f1f commit 54cf91a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion peachjam/views/generic_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ def get_context_data(self, **kwargs):
context["display_type"] = (
"akn" if context["document"].content_html_is_akn else "html"
)
self.prefix_images(context["document"])

if not context["document"].content_html_is_akn:
self.prefix_images(context["document"])
elif hasattr(context["document"], "source_file"):
Expand Down Expand Up @@ -282,7 +284,7 @@ def prefix_images(self, document):
src = img.attrib["src"]
if not src.startswith("/") and not src.startswith("data:"):
img.attrib["src"] = (
document.expression_frbr_uri + "/media/" + img.attrib["src"]
document.expression_frbr_uri + "/" + img.attrib["src"]
)

document.content_html = html.tostring(root, encoding="unicode")
Expand Down

0 comments on commit 54cf91a

Please sign in to comment.