From faf3bc3966c33a62dcfb554f13568312b4ba6f55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 25 Feb 2025 16:19:53 +0100 Subject: [PATCH] Do not fetch Shopify locations without session parameters Closes #13888 (grafted from 667e32ccbbeef4976117078240b1b98cf20e3449) --HG-- branch : 7.0 --- modules/web_shop_shopify/web.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/web_shop_shopify/web.py b/modules/web_shop_shopify/web.py index 5551066273..215a560602 100644 --- a/modules/web_shop_shopify/web.py +++ b/modules/web_shop_shopify/web.py @@ -3,6 +3,7 @@ import datetime as dt import urllib.parse from decimal import Decimal +from operator import attrgetter import pyactiveresource import shopify @@ -651,7 +652,9 @@ class Shop_Warehouse(ModelView, metaclass=PoolMeta): '_parent_shop.shopify_password') def get_shopify_locations(self): locations = [(None, "")] - if self.shop: + session = attrgetter( + 'shopify_url', 'shopify_version', 'shopify_password') + if self.shop and all(session(self.shop)): locations_cache = self._shopify_locations_cache.get(self.shop.id) if locations_cache is not None: return locations_cache