diff options
Diffstat (limited to 'app/photos')
-rw-r--r-- | app/photos/models.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/photos/models.py b/app/photos/models.py index ac85a50..4249e6f 100644 --- a/app/photos/models.py +++ b/app/photos/models.py @@ -113,6 +113,11 @@ class LuxImage(models.Model): if size == "original": return "%soriginal/%s/%s.%s" % (settings.IMAGES_URL, self.pub_date.strftime("%Y"), base, self.get_image_ext()) else: + if size != 'tn': + s = LuxImageSize.objects.get(name=size) + if s not in self.sizes.all(): + print("new size is "+s.name) + self.sizes.add(s) return "%s%s/%s_%s.%s" % (settings.IMAGES_URL, self.pub_date.strftime("%Y"), base, size, self.get_image_ext()) def get_image_path_by_size(self, size="original"): |