Skip to content

Commit

Permalink
Merge pull request #4 from AdithyanJothir/master
Browse files Browse the repository at this point in the history
Fix(register): updated register_enum function support custom classes
  • Loading branch information
adarshdigievo authored Apr 5, 2023
2 parents 40ee17b + d273922 commit b9a1f24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions graphene_mongo/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b9a1f24

Please sign in to comment.