diff options
author | luxagraf <sng@luxagraf.net> | 2021-08-14 20:39:57 -0400 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2021-08-14 20:39:57 -0400 |
commit | 7f2b0c4230398db35b1cbfffdd640dbb3f0750b4 (patch) | |
tree | 93899f5a66ff93df09977ba12266e5c331b6f4e7 /app | |
parent | 02207b80082fc2273dcad2e9372c87fa0707e890 (diff) |
books: fixed image upload issues
Diffstat (limited to 'app')
-rw-r--r-- | app/books/models.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/books/models.py b/app/books/models.py index 417e587..aa321e1 100644 --- a/app/books/models.py +++ b/app/books/models.py @@ -74,7 +74,7 @@ class Book(Orderable): @receiver(post_save, sender=Book) def post_save_events(sender, update_fields, created, instance, **kwargs): if instance.image: - base_path = "%s/%s/" % (settings.IMAGES_ROOT, "/".join(str(i) for i in instance.image.name.split('/')[:-1])) + base_path = "%s/%s/" % (settings.IMAGES_ROOT, "/".join(str(i) for i in instance.image.name.split('/')[1:-1])) filename, file_extension = os.path.splitext(instance.image.path) img = Image.open(instance.image.path) resize_image(img, None, 160, 78, base_path, "%s_tn%s" % (filename.split('/')[-1], file_extension)) |