mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-01 02:43:27 +03:00
fix graphene_django/forms/mutation.py to project style
This commit is contained in:
parent
be9cffab99
commit
a353f857e5
|
@ -189,13 +189,13 @@ class DjangoModelFormMutation(BaseDjangoFormMutation):
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_form_kwargs(cls, root, info, **input):
|
def get_form_kwargs(cls, root, info, **input):
|
||||||
kwargs = super().get_form_kwargs(root, info, **input)
|
kwargs = super().get_form_kwargs(root, info, **input)
|
||||||
instance = kwargs.get('instance')
|
instance = kwargs.get("instance")
|
||||||
if not instance:
|
if not instance:
|
||||||
return kwargs
|
return kwargs
|
||||||
|
|
||||||
for field in kwargs.get('instance')._meta.fields:
|
for field in kwargs.get("instance")._meta.fields:
|
||||||
if field.name not in kwargs['data'] and field.name != 'id':
|
if field.name not in kwargs["data"] and field.name != "id":
|
||||||
kwargs['data'][field.name] = getattr(instance, field.name)
|
kwargs["data"][field.name] = getattr(instance, field.name)
|
||||||
return kwargs
|
return kwargs
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user