Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Adjust avatar mutations
Marcin Gębalaa3829eafeffc
diff --git a/saleor/graphql/account/mutations.py b/saleor/graphql/account/mutations.pyindex 4300d87b59..ba42a5a458 100644--- a/saleor/graphql/account/mutations.py+++ b/saleor/graphql/account/mutations.py@@ -661,7 +661,7 @@ class UserAvatarUpdate(BaseMutation):user.save()create_user_avatar_thumbnails.delay(user_id=user.pk)- return UserAvatarUpdate(user=user, errors=errors)+ return UserAvatarUpdate(user=user)class UserAvatarDelete(BaseMutation):@@ -674,7 +674,6 @@ class UserAvatarDelete(BaseMutation):@staff_member_requireddef perform_mutation(cls, root, info):user = info.context.user- errors = []user.avatar.delete_sized_images()user.avatar.delete()return UserAvatarDelete(user=user)diff --git a/saleor/graphql/core/utils.py b/saleor/graphql/core/utils.pyindex e607025aa2..8bdb906aa0 100644--- a/saleor/graphql/core/utils.py+++ b/saleor/graphql/core/utils.py@@ -25,4 +25,4 @@ def str_to_enum(name):def validate_image_file(file, field_name):"""Validate if the file is an image."""if not file.content_type.startswith('image/'):- raise ValidationError({field_name: 'Invalid file type.'})+ raise ValidationError({field_name: 'Invalid file type'})