-
-
-
-
So in the case of the built-in file storage, this will work, but if someone is hosting on a service like S3,
crop_image
will return an absolute URL to some third-party server.We should get the URL, and check to see if it's an absolute URL or a relative path. If it's the latter, then we can wrap it in
build_server_url
.
Ensure that e-mails always include absolute URLs for image comments.
Review Request #7688 — Created Oct. 9, 2015 and submitted
The comment thumbnails (selected regions) for image file attachments are
included in e-mail notifications for the review, but when using the built-in
file storage backend, the URLs given to these are relative to the server. This
change makes it so if the returned URL is relative, we prefix it with the
server URL.The problem was that when someone was reviewing an image posted it would not provide a server URL.
I changed image ui, so that when you review an image it now adds the server URL.
I used the email backend so that I could print emails to the console.
Then I posted a review with an image attached and posted a review for the image.
Also, I ran the unit tests and it passed them.
- Testing Done:
-
I used the email backend so that I could print emails to the console.
~ Then I posted an review with an image attached and posted a review for the image. ~ Then I posted n review with an image attached and posted a review for the image. Also, I ran the unit tests and it passed them.
-
Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/ui/image.py Tool: Pyflakes Processed Files: reviewboard/reviews/ui/image.py
- Testing Done:
-
I used the email backend so that I could print emails to the console.
~ Then I posted n review with an image attached and posted a review for the image. ~ Then I posted a review with an image attached and posted a review for the image. Also, I ran the unit tests and it passed them. - Groups:
-
Your summary and description could use some improvement. How about something like this:?
Ensure that e-mails always include absolute URLs for image comments. The comment thumbnails (selected regions) for image file attachments are included in e-mail notifications for the review, but when using the built-in file storage backend, the URLs given to these are relative to the server. This change makes it so if the returned URL is relative, we prefix it with the server URL.
- Summary:
-
Builds an absolute URL containing the full URL to the serverEnsure that e-mails always include absolute URLs for image comments.
- Description:
-
~ The problem was that when someone was reviewing an image posted it would not provide a server URL.
~ The comment thumbnails (selected regions) for image file attachments are
+ included in e-mail notifications for the review, but when using the built-in + file storage backend, the URLs given to these are relative to the server. This + change makes it so if the returned URL is relative, we prefix it with the + server URL.The problem was that when someone was reviewing an image posted it would not provide a server URL. I changed image ui, so that when you review an image it now adds the server URL.