mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Bug fix for static lookup of blank image
This commit is contained in:
parent
0ef033f800
commit
5e9b012031
@ -17,7 +17,6 @@ from django.db.models import Sum
|
||||
from django.apps import apps
|
||||
from django.urls import reverse
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
|
||||
from InvenTree.fields import InvenTreeURLField
|
||||
from InvenTree.status_codes import OrderStatus
|
||||
@ -110,7 +109,7 @@ class Company(models.Model):
|
||||
if self.image:
|
||||
return os.path.join(settings.MEDIA_URL, str(self.image.url))
|
||||
else:
|
||||
return static('/img/blank_image.png')
|
||||
return os.path.join(settings.STATIC_URL, 'img/blank_image.png')
|
||||
|
||||
@property
|
||||
def part_count(self):
|
||||
|
@ -18,7 +18,6 @@ from django.db.models import Sum
|
||||
from django.db.models import prefetch_related_objects
|
||||
from django.core.validators import MinValueValidator
|
||||
|
||||
from django.conf.urls.static import static
|
||||
from django.contrib.auth.models import User
|
||||
from django.db.models.signals import pre_delete
|
||||
from django.dispatch import receiver
|
||||
@ -281,7 +280,7 @@ class Part(models.Model):
|
||||
if self.image:
|
||||
return os.path.join(settings.MEDIA_URL, str(self.image.url))
|
||||
else:
|
||||
return static('/img/blank_image.png')
|
||||
return os.path.join(settings.STATIC_URL, 'img/blank_image.png')
|
||||
|
||||
def validate_unique(self, exclude=None):
|
||||
""" Validate that a part is 'unique'.
|
||||
|
Loading…
Reference in New Issue
Block a user