Simplify save_image_to_storage.
Review Request #7711 — Created Oct. 19, 2015 and submitted
The save_image_to_storage template tag is one of the most ancient parts of
Djblets, and it was being way more complicated and fragile than necessary.
Because storage objects now provide anopen
method that returns aFile
object, we can just write the image directly to storage rather than doing a
temporary file dance.This also goes through and renames variables to not be called "file".
Used this with the PDF thumbnailer, which was encountering some raciness in my
setup.
- Description:
-
The save_image_to_storage template tag is one of the most ancient parts of
Djblets, and it was being way more complicated and fragile than necessary. ~ Because storage objects now provide an `open` method that returns a `File` ~ Because storage objects now provide an open
method that returns aFile
object, we can just write the image directly to storage rather than doing a temporary file dance. - Commit:
-
6b5f13089d27e2430656a1170235551de56d8808fc0ddaf29775dfd31b80ff31475dfe12ba12bbec
-
Tool: PEP8 Style Checker Processed Files: djblets/util/templatetags/djblets_images.py Tool: Pyflakes Processed Files: djblets/util/templatetags/djblets_images.py
- Description:
-
The save_image_to_storage template tag is one of the most ancient parts of
Djblets, and it was being way more complicated and fragile than necessary. Because storage objects now provide an open
method that returns aFile
object, we can just write the image directly to storage rather than doing a temporary file dance. + + This also goes through and renames variables to not be called "file".
- Commit:
-
fc0ddaf29775dfd31b80ff31475dfe12ba12bbecf73210e4ca293acd230c24c449eecbe32c4cd7f6
- Diff:
-
Revision 3 (+15 -25)