Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove client validation from draft orders
fowczarekb4d13f0cd9c0
diff --git a/saleor/graphql/order/mutations/orders.py b/saleor/graphql/order/mutations/orders.pyindex 4714d894c6..9f316bdcb2 100644--- a/saleor/graphql/order/mutations/orders.py+++ b/saleor/graphql/order/mutations/orders.py@@ -124,16 +124,6 @@ class OrderUpdate(DraftOrderUpdate):description = 'Updates an order.'model = models.Order- @classmethod- def clean_input(cls, info, instance, input, errors):- cleaned_input = super().clean_input(info, instance, input, errors)- if not instance.user and not cleaned_input.get('user_email'):- cls.add_error(- errors, field='user_email',- message='User_email field is null while order was created by '- 'anonymous user')- return cleaned_input-@classmethoddef save(cls, info, instance, cleaned_input):super().save(info, instance, cleaned_input)diff --git a/saleor/graphql/order/utils.py b/saleor/graphql/order/utils.pyindex 1dac6e1643..223f786d98 100644--- a/saleor/graphql/order/utils.py+++ b/saleor/graphql/order/utils.py@@ -24,9 +24,4 @@ def can_finalize_draft_order(order, errors):field='shipping',message='Shipping method is not valid for chosen shipping ''address'))- if not order.user and not order.user_email:- errors.append(- Error(- field=None,- message='Both user and user_email fields are null'))return errors