summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/books/models.py2
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))