Same fix for Part API

This commit is contained in:
Oliver Walters 2020-04-05 22:59:45 +10:00
parent 94b9878c8d
commit 791eb63f35

View File

@ -225,11 +225,17 @@ class PartList(generics.ListCreateAPIView):
# Use the 'thumbnail' image here instead of the full-size image # Use the 'thumbnail' image here instead of the full-size image
# Note: The full-size image is used when requesting the /api/part/<x>/ endpoint # Note: The full-size image is used when requesting the /api/part/<x>/ endpoint
if img:
fn, ext = os.path.splitext(img) fn, ext = os.path.splitext(img)
thumb = "{fn}.thumbnail{ext}".format(fn=fn, ext=ext) thumb = "{fn}.thumbnail{ext}".format(fn=fn, ext=ext)
item['thumbnail'] = os.path.join(settings.MEDIA_URL, thumb) thumb = os.path.join(settings.MEDIA_URL, thumb)
else:
thumb = ''
item['thumbnail'] = thumb
del item['image'] del item['image']