summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-02-27 15:47:32 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-02-27 15:47:32 +0100
commit05eeada23bd7065bf750e88c4c3125676e9ace92 (patch)
treecb99bb453ae23db575810471c660dda06a98bd77 /ishtar_common/models.py
parent96dab3e5402589d9537df776bbcd7df816ae54f2 (diff)
downloadIshtar-05eeada23bd7065bf750e88c4c3125676e9ace92.tar.bz2
Ishtar-05eeada23bd7065bf750e88c4c3125676e9ace92.zip
Allow no resizing of images (by explicit parameter in settings)
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index f482cf61d..6f8a66f3b 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -896,9 +896,10 @@ class ImageModel(models.Model):
image = image.convert('RGB')
# resize if necessary
- self.image.save(filename,
- self.create_thumb(image, self.IMAGE_MAX_SIZE),
- save=False)
+ if self.IMAGE_MAX_SIZE:
+ self.image.save(filename,
+ self.create_thumb(image, self.IMAGE_MAX_SIZE),
+ save=False)
if old_path != self.image.path:
try: