You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [6]: l.image.generate_thumbnail({'size':(50,50)})
---------------------------------------------------------------------------
Traceback (most recent call last)
/home/pete/sandbox/cloudfiles/project/ in ()
/home/pete/sandbox/cloudfiles/src/easy-thumbnails/easy_thumbnails/files.py in generate_thumbnail(self, thumbnail_options)
176 filename = self.get_thumbnail_name(thumbnail_options)
177 thumbnail = ThumbnailFile(filename, ContentFile(data),
--> 178 storage=self.thumbnail_storage)
179 thumbnail.image = thumbnail_image
180 thumbnail._committed = False
: 'ThumbnailerImageFieldFile' object has no attribute 'thumbnail_storage'
This fixes the issue:
diff --git a/easy_thumbnails/fields.py b/easy_thumbnails/fields.py
index d49af50..ee77d2e 100644
--- a/easy_thumbnails/fields.py
+++ b/easy_thumbnails/fields.py
@@ -16,10 +16,11 @@ class ThumbnailerField(FileField):
def __init__(self, *args, **kwargs):
# Arguments not explicitly defined so that the normal ImageField
# positional arguments can be used.
- self.thumbnail_storage = kwargs.pop('thumbnail_storage', None)
super(ThumbnailerField, self).__init__(*args, **kwargs)
+ self.thumbnail_storage = kwargs.pop('thumbnail_storage', self.storage)
+
def south_field_triple(self):
"""
Return a suitable description of this field for South.
The text was updated successfully, but these errors were encountered:
This fixes the issue:
The text was updated successfully, but these errors were encountered: