From 302c9de73b2dbcf0c531c1ef60596a1971ce9c13 Mon Sep 17 00:00:00 2001 From: Rohan Date: Thu, 22 Dec 2022 15:45:46 +0530 Subject: [PATCH] fix: find token cache specifically for admin [CU-37q6frk] (#39) --- .../doctype/shopify_settings/shopify_settings.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shopify_integration/shopify_integration/doctype/shopify_settings/shopify_settings.py b/shopify_integration/shopify_integration/doctype/shopify_settings/shopify_settings.py index 1920c4d..63620ac 100644 --- a/shopify_integration/shopify_integration/doctype/shopify_settings/shopify_settings.py +++ b/shopify_integration/shopify_integration/doctype/shopify_settings/shopify_settings.py @@ -52,6 +52,8 @@ def validate(self): self.update_webhooks() def get_shopify_access_token(self): + from shopify_integration.oauth import DEFAULT_TOKEN_USER + if self.app_type not in ("Custom (OAuth)", "Public"): return @@ -60,7 +62,7 @@ def get_shopify_access_token(self): ) token_cache: Optional["TokenCache"] = connected_app.get_token_cache( - frappe.session.user + DEFAULT_TOKEN_USER, ) if token_cache: