Skip to content

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

Always provide a value for userEmail

Patryk Zawadzki07868e268277
diff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.py
index 841ace5723..243d04f8ef 100644
--- a/saleor/graphql/order/types.py
+++ b/saleor/graphql/order/types.py
@@ -54,6 +54,13 @@ class Order(CountableDjangoObjectType):
def resolve_status_display(obj, info):
return obj.get_status_display()
+ @staticmethod
+ def resolve_user_email(obj, info):
+ if obj.user_email:
+ return obj.user_email
+ if obj.user_id:
+ return obj.user.email
+
class OrderHistoryEntry(CountableDjangoObjectType):
class Meta: