Skip to content

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

Improve attaching order to user fail message

Anna Siwik5260aa141778
diff --git a/saleor/order/views.py b/saleor/order/views.py
index d66d20229c..d754f7ff46 100644
--- a/saleor/order/views.py
+++ b/saleor/order/views.py
@@ -152,15 +152,16 @@ def checkout_success(request, token):
@login_required
def connect_order_with_user(request, token):
+ """Connects newly created order to just logged in user."""
try:
order = Order.objects.get(user_email=request.user.email, token=token)
except Order.DoesNotExist:
order = None
if not order:
msg = pgettext_lazy(
- 'storefront message',
- 'You cannot connect order with this account due to e-mail '
- 'difference')
+ 'Connect order with user warning message',
+ 'We cannot connect order with this account due to difference '
+ 'of e-mail given in checkout')
messages.warning(request, msg)
return redirect('profile:details')
attach_order_to_user(order, request.user)