summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/media/models.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/media/models.py b/app/media/models.py
index b67699b..1c2037a 100644
--- a/app/media/models.py
+++ b/app/media/models.py
@@ -204,7 +204,7 @@ class LuxImage(models.Model):
def save(self, *args, **kwargs):
created = self.pk is None
if created:
- self.sizes.add(LuxImageSize.objects.get(name="tn"))
+ self.sizes.add(LuxImageSize.objects.get(slug="tn"))
img = Image.open(self.image.path)
self.height = img.height
self.width = img.width
@@ -350,8 +350,6 @@ class LuxAudio(models.Model):
def update_photo_sizes(sender, instance, **kwargs):
# update the local cache of sizes
instance.sizes_cache = ",".join(s.slug for s in instance.sizes.all())
- instance.save()
- print(instance.get_sizes)
for size in instance.get_sizes:
# check each size and see if there's an image there already
my_file = Path(instance.get_image_path_by_size(size))
@@ -384,5 +382,5 @@ 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()