Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix email image payload (#12033)
Iga Karbowiakffa079c9ae68
diff --git a/saleor/order/notifications.py b/saleor/order/notifications.pyindex 3b64a007f7..c69f611313 100644--- a/saleor/order/notifications.py+++ b/saleor/order/notifications.py@@ -8,7 +8,7 @@ from ..account.models import StaffNotificationRecipientfrom ..core.notification.utils import get_site_contextfrom ..core.notify_events import NotifyEventTypefrom ..core.prices import quantize_price, quantize_price_fields-from ..core.utils.url import prepare_url+from ..core.utils.url import build_absolute_uri, prepare_urlfrom ..discount import OrderDiscountTypefrom ..graphql.core.utils import to_global_id_or_nonefrom ..product import ProductMediaTypes@@ -27,8 +27,8 @@ def get_image_payload(instance: ProductMedia):# This is temporary solution, the get_product_image_thumbnail_url# should be optimize - we should fetch all thumbnails at once instead of# fetching thumbnails by one for each size- str(size): get_image_or_proxy_url(- None, str(instance.id), "ProductMedia", size, None+ str(size): build_absolute_uri(+ get_image_or_proxy_url(None, str(instance.id), "ProductMedia", size, None))for size in THUMBNAIL_SIZES}diff --git a/saleor/order/tests/test_notifications.py b/saleor/order/tests/test_notifications.pyindex 149b249868..6ab5f9fb62 100644--- a/saleor/order/tests/test_notifications.py+++ b/saleor/order/tests/test_notifications.py@@ -677,4 +677,7 @@ def test_get_default_images_payload(product_with_image):# thenimages_payload = payload["first_image"]["original"]for th_size in THUMBNAIL_SIZES:- assert images_payload[str(th_size)] == f"/thumbnail/{media_id}/{th_size}/"+ assert (+ images_payload[str(th_size)]+ == f"http://mirumee.com/thumbnail/{media_id}/{th_size}/"+ )