Skip to content

Commit 765cd4f

Browse files
committed
linter fixes
1 parent a2d0e64 commit 765cd4f

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

django_mongodb_backend/fields/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,15 @@
2727
from .polymorphic_embedded_model_array import PolymorphicEmbeddedModelArrayField
2828

2929
__all__ = [
30-
"has_encrypted_fields",
31-
"register_fields",
3230
"ArrayField",
3331
"EmbeddedModelArrayField",
3432
"EmbeddedModelField",
3533
"EncryptedBigIntegerField",
3634
"EncryptedBinaryField",
3735
"EncryptedBooleanField",
3836
"EncryptedCharField",
39-
"EncryptedDateTimeField",
4037
"EncryptedDateField",
38+
"EncryptedDateTimeField",
4139
"EncryptedDecimalField",
4240
"EncryptedEmailField",
4341
"EncryptedFieldMixin",
@@ -51,6 +49,8 @@
5149
"ObjectIdField",
5250
"PolymorphicEmbeddedModelArrayField",
5351
"PolymorphicEmbeddedModelField",
52+
"has_encrypted_fields",
53+
"register_fields",
5454
"register_fields",
5555
]
5656

django_mongodb_backend/routers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ def allow_migrate(self, db, app_label, model_name=None, **hints):
99
EmbeddedModels don't have their own collection and must be ignored by
1010
dumpdata.
1111
"""
12+
from django_mongodb_backend.models import EmbeddedModel # noqa: PLC0415
1213

1314
if not model_name:
1415
return None
@@ -17,9 +18,6 @@ def allow_migrate(self, db, app_label, model_name=None, **hints):
1718
except LookupError:
1819
return None
1920

20-
# Delay import for `register_routers` patching.
21-
from django_mongodb_backend.models import EmbeddedModel
22-
2321
return False if issubclass(model, EmbeddedModel) else None
2422

2523

tests/encryption_/tests.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,15 +186,14 @@ def setUp(self):
186186
def setUpClass(cls):
187187
super().setUpClass()
188188
try:
189-
from pymongo_auth_aws.auth import AwsCredential
190-
191-
cls.patch_aws = patch(
192-
"pymongocrypt.synchronous.credentials.aws_temp_credentials",
193-
return_value=AwsCredential(username="", password="", token=""),
194-
)
189+
from pymongo_auth_aws.auth import AwsCredential # noqa: PLC0415
195190
except ImportError:
196191
cls.skipTest(cls, "pymongo_auth_aws not installed, skipping AWS credentials tests")
197192

193+
cls.patch_aws = patch(
194+
"pymongocrypt.synchronous.credentials.aws_temp_credentials",
195+
return_value=AwsCredential(username="", password="", token=""),
196+
)
198197
cls.patch_aws.start()
199198

200199
cls.patch_azure = patch(

0 commit comments

Comments
 (0)