summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2019-11-09 20:10:02 -0500
committerluxagraf <sng@luxagraf.net>2019-11-09 20:10:02 -0500
commit48937d27a1de25b8c03bc8051d3393d6c69b3867 (patch)
tree7ef89decd93a704c4258b2266f4f58fa5e1e6882
parent6bccb82f7751d8c126f0342ccc97ff5311fa2ed6 (diff)
fixed a bug in product admin thumbnails
-rw-r--r--app/products/models.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/app/products/models.py b/app/products/models.py
index d4dd5a8..375c0cb 100644
--- a/app/products/models.py
+++ b/app/products/models.py
@@ -68,15 +68,12 @@ class Product(models.Model):
return ''
def admin_thumbnail(self):
- return format_html('<img src="%s" width="100" style="width:100px" />' % (self.get_image_url()))
+ return format_html('<img src="%s" width="100" style="width:100px" />' % (self.featured_image.get_thumbnail_url()))
admin_thumbnail.short_description = 'Thumbnail'
def get_full_name(self):
return "%s %s" % (self.brand.name, self.name)
- def get_image_url(self):
- return '%sbook-covers/%s' % (settings.IMAGES_URL, self.image.name.split('/')[-1])
-
def save(self, *args, **kwargs):
md = render_images(self.body_markdown)
prods = render_products(md)