Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken images cause the page to 500 #164

Open
sowasred2012 opened this issue Apr 1, 2022 · 0 comments
Open

Broken images cause the page to 500 #164

sowasred2012 opened this issue Apr 1, 2022 · 0 comments

Comments

@sowasred2012
Copy link
Contributor

Discovered while investigating: canonical/ubuntu.com#11441

If a blog article has a broken image, it seems like Wordpress sets the source of the image as blob:https://blahblahblah, and when the module attempts to render the content:

https://github.com/canonical-web-and-design/canonicalwebteam.blog/blob/9937034f9c4335dd02f6c0d3cd3222e2ba145a35/canonicalwebteam/blog/blog_api.py#L166

it passes a bad URL to image_template, which then raises an exception.

In the issue, this led to any page featuring the blog post as a related post to also 500, so it would be good if we could catch the exception and handle it differently.

While debugging, we printed out what was returned in the article object, which is how we found the article with the broken image - here's a pastebin, searching the "content" for blob: shows the broken image URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants