mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-13 17:52:19 +03:00
use to_represenation
in favor of get_attribute
This commit is contained in:
parent
b8a2d5953a
commit
23efdb8489
|
@ -137,10 +137,5 @@ class SerializerMutation(ClientIDMutation):
|
||||||
@classmethod
|
@classmethod
|
||||||
def perform_mutate(cls, serializer, info):
|
def perform_mutate(cls, serializer, info):
|
||||||
obj = serializer.save()
|
obj = serializer.save()
|
||||||
|
kwargs = serializer.to_representation(obj)
|
||||||
kwargs = {}
|
|
||||||
for f, field in serializer.fields.items():
|
|
||||||
if not field.write_only:
|
|
||||||
kwargs[f] = field.get_attribute(obj)
|
|
||||||
|
|
||||||
return cls(errors=None, **kwargs)
|
return cls(errors=None, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user