Change mutation

This commit is contained in:
ariel1899 2020-04-20 10:06:09 -04:00
parent 2743aae492
commit 2887830cf0

View File

@ -10,7 +10,6 @@ from graphene.types.mutation import MutationOptions
# InputObjectType, # InputObjectType,
# ) # )
from graphene.types.utils import yank_fields_from_attrs from graphene.types.utils import yank_fields_from_attrs
from graphene.utils.str_converters import to_camel_case
from graphene_django.registry import get_global_registry from graphene_django.registry import get_global_registry
from ..types import ErrorType from ..types import ErrorType
@ -45,13 +44,7 @@ class BaseDjangoFormMutation(ClientIDMutation):
if form.is_valid(): if form.is_valid():
return cls.perform_mutate(form, info) return cls.perform_mutate(form, info)
else: else:
errors = [ errors = ErrorType.from_errors(form.errors)
ErrorType(
field=to_camel_case(key) if key != "__all__" else key,
messages=value,
)
for key, value in form.errors.items()
]
return cls(errors=errors) return cls(errors=errors)