mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-15 03:25:42 +00:00
Use the company thumbnail in the Company API
This commit is contained in:
@ -122,6 +122,14 @@ class Company(models.Model):
|
||||
else:
|
||||
return os.path.join(settings.STATIC_URL, 'img/blank_image.png')
|
||||
|
||||
def get_thumbnail_url(self):
|
||||
""" Return the URL for the thumbnail image for this Company """
|
||||
|
||||
if self.image:
|
||||
return os.path.join(settings.MEDIA_URL, str(self.image.thumbnail.url))
|
||||
else:
|
||||
return os.path.join(settings.STATIC_URL, 'img/blank_image.thumbnail.png')
|
||||
|
||||
@property
|
||||
def part_count(self):
|
||||
""" The number of parts supplied by this company """
|
||||
|
Reference in New Issue
Block a user