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
|
||||
# Note: The full-size image is used when requesting the /api/part/<x>/ endpoint
|
||||
|
||||
if img:
|
||||
fn, ext = os.path.splitext(img)
|
||||
|
||||
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']
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user