mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Same fix for Part API
This commit is contained in:
parent
94b9878c8d
commit
791eb63f35
@ -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
|
||||||
fn, ext = os.path.splitext(img)
|
|
||||||
|
|
||||||
thumb = "{fn}.thumbnail{ext}".format(fn=fn, ext=ext)
|
if img:
|
||||||
|
fn, ext = os.path.splitext(img)
|
||||||
|
|
||||||
item['thumbnail'] = os.path.join(settings.MEDIA_URL, thumb)
|
thumb = "{fn}.thumbnail{ext}".format(fn=fn, ext=ext)
|
||||||
|
|
||||||
|
thumb = os.path.join(settings.MEDIA_URL, thumb)
|
||||||
|
else:
|
||||||
|
thumb = ''
|
||||||
|
|
||||||
|
item['thumbnail'] = thumb
|
||||||
|
|
||||||
del item['image']
|
del item['image']
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user