Use dict.get instead of getattr to retrieve user errors from Shopify request

The GraphQL library returns dict instead of object.

Closes #14964
(grafted from 4ec0ec9f0ae00251716f1e731c1d936857151fd9)

--HG--
branch : 8.0
This commit is contained in:
Cédric Krier
2026-07-21 17:32:21 +02:00
parent 033e35cd88
commit 062b38f1ce
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ def shopify_request(shop, query, variables=None, user_errors=None):
names = user_errors.split('.')
errors = result.data
for name in names:
errors = getattr(errors, name, None)
errors = errors.get(name, None)
if errors is None:
break
if errors:
+1 -1
View File
@@ -331,7 +331,7 @@ class Shop(metaclass=PoolMeta):
names = user_errors.split('.')
errors = result.data
for name in names:
errors = getattr(errors, name, None)
errors = errors.get(name, None)
if errors is None:
break
if errors: