mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
Merge branch 'master' of github.com:iMaGiNiX/django-avatar into iMaGiNiX-master
This commit is contained in:
commit
198946a8af
1 changed files with 4 additions and 3 deletions
|
|
@ -179,9 +179,10 @@ class Avatar(models.Model):
|
|||
thumb_file = ContentFile(thumb.getvalue())
|
||||
else:
|
||||
thumb_file = File(orig)
|
||||
thumb = self.avatar.storage.save(
|
||||
self.avatar_name(width, height), thumb_file
|
||||
)
|
||||
thumb_name = self.avatar_name(width, height)
|
||||
if self.avatar.storage.exists(thumb_name):
|
||||
self.avatar.storage.delete(thumb_name)
|
||||
thumb = self.avatar.storage.save(thumb_name, thumb_file)
|
||||
except IOError:
|
||||
thumb_file = File(orig)
|
||||
thumb = self.avatar.storage.save(
|
||||
|
|
|
|||
Loading…
Reference in a new issue