-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Dynamic Image Serve View is failing #11716
Comments
Hey, I am new to wagtail and I would like to pick this issue. To my understanding this issue is occurring because of removing |
This does indeed look like a bug. I'd removed it because in testing it hadn't made a difference. It seems in some cases, it does.
|
@RealOrangeOne thanks for the prompt reply. In addition to adding back |
Glad to see you're interested in fixing this! I think the main thing will be working out in what case this causes issues currently, and attempting to write a test to address it. I suspect writing a test which causes the issue first is a good way to go, and then add the line back and confirm the test now passes. The exact cause may depend on the file backend used - it's possible this only occurs with certain backends. @KalobTaulien what storage backend are you using? That might help narrow down a proper fix. |
Sure I will start working on it and create a pr. Please review it once I finish it and thanks for all the help till now. |
Hey @RealOrangeOne, even though I can confirm that adding |
@RealOrangeOne I had tried it with various backends, but this happens even with Wagtail's default setup after running @LANCECORREIA Great job picking up this ticket and running with it, you're doing fantastic! |
Added back a line that was removed in a previous commit,"rendition.file.open("rb")" in serve.py. Also, created a test in admin/tests/viewsets , test_image_presence.py that confirms that the issue has been resolved. The test looks for a status error code 500 in the display of an image, something that happenned when the dynamic serve view failed. If it finds it, the test fails. The test also passes when we dont't use a dynamic serve view.
Added back a line that was removed in a previous commit,"rendition.file.open("rb")" in serve.py. Also, created a test in admin/tests/viewsets , test_image_presence.py that confirms that the issue has been resolved. The test looks for a status error code 500 in the display of an image, something that happenned when the dynamic serve view failed. If it finds it, the test fails. The test also passes when we dont't use a dynamic serve view.
Until fix is merged if someone get the same error it could be fixed at your project locally by changing Serve behavior to redirect ie |
Issue Summary
When using the Dynamic image serve view, from the documentation (https://docs.wagtail.org/en/stable/advanced_topics/images/image_serve_view.html) the URL's are generated, but they cannot be accessed from a GET request.
Steps to Reproduce
image = models.ForeignKey( get_image_model(), ...)
field to the HomePage class. Make migrations and apply them.Other details
Terminal output is:
What the browser outputs:
Technical details
Python: 3.11
Wagtail: 6.0.1
Django: 5.0.2
Working on this
Anyone can contribute to this. View our contributing guidelines, add a comment to the issue once you’re ready to start.
The text was updated successfully, but these errors were encountered: