Skip to content

Commit

Permalink
Have Thumb.image_file return tmp thumb if image is not yet saved
Browse files Browse the repository at this point in the history
  • Loading branch information
fdintino committed Apr 20, 2017
1 parent d685cf7 commit 1801052
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cropduster/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def __unicode__(self):

@property
def image_file(self):
return Image.get_file_for_size(image=self.image, size_name=self.name)
return Image.get_file_for_size(
image=self.image, size_name=self.name,
tmp=not(getattr(self.image, 'pk', None)))

@property
def url(self):
Expand Down

0 comments on commit 1801052

Please sign in to comment.