Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix passing error codes
Marcin Gębala99b7dc8f1572
diff --git a/saleor/graphql/account/mutations/account.py b/saleor/graphql/account/mutations/account.pyindex da791f27cd..f72dc4ffda 100644--- a/saleor/graphql/account/mutations/account.py+++ b/saleor/graphql/account/mutations/account.py@@ -54,10 +54,7 @@ class AccountRegister(ModelMutation):@classmethoddef mutate(cls, root, info, **data):response = super().mutate(root, info, **data)- if not response.errors:- response.requires_confirmation = (- settings.ENABLE_ACCOUNT_CONFIRMATION_BY_EMAIL- )+ response.requires_confirmation = settings.ENABLE_ACCOUNT_CONFIRMATION_BY_EMAILreturn response@classmethod@@ -66,15 +63,22 @@ class AccountRegister(ModelMutation):return super().clean_input(info, instance, data, input_cls=None)elif not data.get("redirect_url"):raise ValidationError(- {"redirect_url": "This field is required."},- code=AccountErrorCode.INVALID,+ {+ "redirect_url": ValidationError(+ "This field is required.", code=AccountErrorCode.REQUIRED+ )+ })try:validate_storefront_url(data["redirect_url"])except ValidationError as error:raise ValidationError(- {"redirect_url": error}, code=AccountErrorCode.INVALID+ {+ "redirect_url": ValidationError(+ error.message, code=AccountErrorCode.INVALID+ )+ })return super().clean_input(info, instance, data, input_cls=None)