diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/media/models.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/media/models.py b/app/media/models.py index f50af8a..4fb81e3 100644 --- a/app/media/models.py +++ b/app/media/models.py @@ -202,7 +202,9 @@ class LuxImage(models.Model): return False def save(self, *args, **kwargs): - self.sizes_cache = ",".join(s.slug for s in self.sizes.all()) + created = self.pk is None + if not created: + self.sizes_cache = ",".join(s.slug for s in self.sizes.all()) super(LuxImage, self).save() @@ -359,7 +361,7 @@ def update_photo_sizes(sender, instance, **kwargs): sizes = instance.sizes.all() if sizes: instance.sizes_cache = ",".join(s.slug for s in sizes) - print(instance.sizes.all()) + instance.save() for size in instance.get_sizes: print("SIZE is: %s" % size) # check each size and see if there's an image there already @@ -393,5 +395,4 @@ def update_photo_sizes(sender, instance, **kwargs): # file exists, might add something here to force it to do the above when I want print("file %s exists" % size) pass - instance.save() |