diff --git a/graphene_mongo/registry.py b/graphene_mongo/registry.py index bed3e63f..8d57713e 100644 --- a/graphene_mongo/registry.py +++ b/graphene_mongo/registry.py @@ -26,9 +26,9 @@ def register(self, cls): def register_enum(self, cls): from enum import EnumMeta - assert type(cls) == EnumMeta, 'Only EnumMeta can be registered, received "{}"'.format( - cls.__name__ - ) + assert isinstance( + cls, EnumMeta + ), f'Only EnumMeta can be registered, received "{cls.__name__}"' if not cls.__name__.endswith('Enum'): name = cls.__name__ + 'Enum' else: