Skip to content

Commit b2096db

Browse files
committed
linting
1 parent 7bb7342 commit b2096db

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

django_mongodb_backend/fields/auto.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ def deconstruct(self):
1616
if self.db_column == "_id":
1717
del kwargs["db_column"]
1818
if path.startswith("django_mongodb_backend.fields.auto"):
19-
path = path.replace("django_mongodb_backend.fields.auto", "django_mongodb_backend.fields")
19+
path = path.replace(
20+
"django_mongodb_backend.fields.auto", "django_mongodb_backend.fields"
21+
)
2022
return name, path, args, kwargs
2123

2224
def get_prep_value(self, value):
@@ -33,7 +35,9 @@ def get_prep_value(self, value):
3335
# A manually assigned integer ID?
3436
if isinstance(value, str) and value.isdigit():
3537
return int(value)
36-
raise ValueError(f"Field '{self.name}' expected an ObjectId but got {value!r}.") from e
38+
raise ValueError(
39+
f"Field '{self.name}' expected an ObjectId but got {value!r}."
40+
) from e
3741

3842
def get_internal_type(self):
3943
return "ObjectIdAutoField"

django_mongodb_backend/fields/objectid.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ class ObjectIdField(ObjectIdMixin, Field):
4747
def deconstruct(self):
4848
name, path, args, kwargs = super().deconstruct()
4949
if path.startswith("django_mongodb_backend.fields.objectid"):
50-
path = path.replace("django_mongodb_backend.fields.objectid", "django_mongodb_backend.fields")
50+
path = path.replace(
51+
"django_mongodb_backend.fields.objectid",
52+
"django_mongodb_backend.fields",
53+
)
5154
return name, path, args, kwargs
5255

5356
def get_internal_type(self):

0 commit comments

Comments
 (0)