Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix placeholder lookup

Patryk Zawadzkia499f8d5e991
diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.py
index 33ca3cf450..cd2e753d40 100644
--- a/saleor/core/utils/random_data.py
+++ b/saleor/core/utils/random_data.py
@@ -82,8 +82,9 @@ def create_variant(product, **kwargs):
def create_product_image(product, placeholder_dir):
+ placeholder_root = os.path.join(settings.PROJECT_ROOT, placeholder_dir)
img_path = '%s/%s' % (placeholder_dir,
- random.choice(os.listdir(placeholder_dir)))
+ random.choice(os.listdir(placeholder_root)))
image = ProductImage(
product=product,
image=File(open(img_path, 'rb'))).save()