Skip to content

Commit 08295c6

Browse files
committed
bump: dependencies
graphene: 3.4.3 graphql-core: 3.2.5 pymongo: 4.10.1 mongoengine: 0.29.1
1 parent 9a594fe commit 08295c6

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

graphene_mongo/fields.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ class MongoengineConnectionField(ConnectionField):
4949
def __init__(self, type, *args, **kwargs):
5050
get_queryset = kwargs.pop("get_queryset", None)
5151
if get_queryset:
52-
assert callable(
53-
get_queryset
54-
), "Attribute `get_queryset` on {} must be callable.".format(self)
52+
assert callable(get_queryset), (
53+
"Attribute `get_queryset` on {} must be callable.".format(self)
54+
)
5555
self._get_queryset = get_queryset
5656
super(MongoengineConnectionField, self).__init__(type, *args, **kwargs)
5757

@@ -64,9 +64,9 @@ def type(self):
6464
from .types import MongoengineObjectType
6565

6666
_type = super(ConnectionField, self).type
67-
assert issubclass(
68-
_type, MongoengineObjectType
69-
), "MongoengineConnectionField only accepts MongoengineObjectType types"
67+
assert issubclass(_type, MongoengineObjectType), (
68+
"MongoengineConnectionField only accepts MongoengineObjectType types"
69+
)
7070
assert _type._meta.connection, "The type {} doesn't have a connection".format(
7171
_type.__name__
7272
)

graphene_mongo/fields_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ def type(self):
4545
from .types_async import AsyncMongoengineObjectType
4646

4747
_type = super(ConnectionField, self).type
48-
assert issubclass(
49-
_type, AsyncMongoengineObjectType
50-
), "AsyncMongoengineConnectionField only accepts AsyncMongoengineObjectType types"
48+
assert issubclass(_type, AsyncMongoengineObjectType), (
49+
"AsyncMongoengineConnectionField only accepts AsyncMongoengineObjectType types"
50+
)
5151
assert _type._meta.connection, "The type {} doesn't have a connection".format(
5252
_type.__name__
5353
)

graphene_mongo/registry.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ def register(self, cls):
1515
from .types import GrapheneMongoengineObjectTypes
1616
from .types_async import AsyncGrapheneMongoengineObjectTypes
1717

18-
assert (
19-
issubclass(cls, GrapheneMongoengineObjectTypes)
20-
or issubclass(cls, AsyncGrapheneMongoengineObjectTypes)
21-
), 'Only Mongoengine/Async Mongoengine object types can be registered, received "{}"'.format(
22-
cls.__name__
18+
assert issubclass(cls, GrapheneMongoengineObjectTypes) or issubclass(
19+
cls, AsyncGrapheneMongoengineObjectTypes
20+
), (
21+
'Only Mongoengine/Async Mongoengine object types can be registered, received "{}"'.format(
22+
cls.__name__
23+
)
2324
)
2425
assert cls._meta.registry == self, "Registry for a Model have to match."
2526
if issubclass(cls, GrapheneMongoengineObjectTypes):
@@ -36,9 +37,9 @@ def register(self, cls):
3637
def register_enum(self, cls):
3738
from enum import EnumMeta
3839

39-
assert isinstance(
40-
cls, EnumMeta
41-
), f'Only EnumMeta can be registered, received "{cls.__name__}"'
40+
assert isinstance(cls, EnumMeta), (
41+
f'Only EnumMeta can be registered, received "{cls.__name__}"'
42+
)
4243
if not cls.__name__.endswith("Enum"):
4344
name = cls.__name__ + "Enum"
4445
else:

graphene_mongo/types.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ def __init_subclass_with_meta__(
164164

165165
if _meta:
166166
assert isinstance(_meta, MongoengineGenericObjectTypeOptions), (
167-
"_meta must be an instance of MongoengineGenericObjectTypeOptions, "
168-
"received {}"
167+
"_meta must be an instance of MongoengineGenericObjectTypeOptions, received {}"
169168
).format(_meta.__class__)
170169
else:
171170
_meta = MongoengineGenericObjectTypeOptions(option_type)

0 commit comments

Comments
 (0)