mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-07-08 22:33:13 +03:00
Don't unwrap lazy user, instead check its class.
This commit is contained in:
parent
b9f0e4f9ae
commit
7b96114202
|
@ -268,12 +268,9 @@ class DjangoObjectType(ObjectType):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def is_type_of(cls, root, info):
|
def is_type_of(cls, root, info):
|
||||||
if isinstance(root, SimpleLazyObject):
|
|
||||||
root._setup()
|
|
||||||
root = root._wrapped
|
|
||||||
if isinstance(root, cls):
|
if isinstance(root, cls):
|
||||||
return True
|
return True
|
||||||
if not is_valid_django_model(type(root)):
|
if not is_valid_django_model(type(root.__class__)):
|
||||||
raise Exception(('Received incompatible instance "{}".').format(root))
|
raise Exception(('Received incompatible instance "{}".').format(root))
|
||||||
|
|
||||||
if cls._meta.model._meta.proxy:
|
if cls._meta.model._meta.proxy:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user