removing django dependency
This commit is contained in:
alejandronunez 2019-03-07 08:55:25 -05:00 committed by GitHub
commit 200353d014
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,5 @@
# from django import forms
from collections import OrderedDict
from django.forms import ALL_FIELDS
import graphene
from graphene import Field, InputField
from graphene.relay.mutation import ClientIDMutation
@ -47,7 +46,7 @@ class BaseDjangoFormMutation(ClientIDMutation):
return cls.perform_mutate(form, info)
else:
errors = [
ErrorType(field=to_camel_case(key) if key != ALL_FIELDS else key, messages=value)
ErrorType(field=to_camel_case(key) if key != '__all__' else key, messages=value)
for key, value in form.errors.items()
]