mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-23 23:20:47 +03:00
Fix bug with "private" attrs
I believe this is a bug but I'm not actually sure of the desired intentions of underscore prefixed kwargs. When you pass an underscore kwargs, this currently raises an AttributeError because of the first conditional. The fix is to swap these conditionals to allow for setting of underscore attributes.
This commit is contained in:
parent
557ec44a13
commit
1d6fbea1f4
|
@ -107,7 +107,7 @@ class ObjectType(six.with_metaclass(ObjectTypeMeta)):
|
|||
if kwargs:
|
||||
for prop in list(kwargs):
|
||||
try:
|
||||
if isinstance(getattr(self.__class__, prop), property) or prop.startswith('_'):
|
||||
if prop.startswith('_') or isinstance(getattr(self.__class__, prop), property):
|
||||
setattr(self, prop, kwargs.pop(prop))
|
||||
except AttributeError:
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue
Block a user