summaryrefslogtreecommitdiff
path: root/app/books/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/books/models.py')
-rw-r--r--app/books/models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/books/models.py b/app/books/models.py
index 59f0ae3..ef6a9b6 100644
--- a/app/books/models.py
+++ b/app/books/models.py
@@ -10,7 +10,7 @@ from utils.widgets import markdown_to_html
def get_upload_path(self, filename):
- return "images/book-covers/%s/%s" % (datetime.datetime.today().strftime("%Y"), filename)
+ return "images/book-covers/%s" % (filename)
class Book(models.Model):
@@ -49,7 +49,7 @@ class Book(models.Model):
return reverse("books:detail", kwargs={"slug": self.slug})
def get_image_url(self):
- return '%sbook-covers/%s.jpg' % (settings.IMAGES_URL, self.slug)
+ return '%sbook-covers/%s' % (settings.IMAGES_URL, self.image.name.split('/')[-1])
def get_rating(self):
return int(self.rating)