mirror of https://github.com/django/django.git
Fixed warnings per flake8 6.1.0.
This commit is contained in:
parent
4087367ba8
commit
22b0b73c77
|
@ -15,7 +15,7 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
- repo: https://github.com/PyCQA/flake8
|
- repo: https://github.com/PyCQA/flake8
|
||||||
rev: 6.0.0
|
rev: 6.1.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
- repo: https://github.com/pre-commit/mirrors-eslint
|
- repo: https://github.com/pre-commit/mirrors-eslint
|
||||||
|
|
|
@ -97,7 +97,7 @@ class Extract(TimezoneMixin, Transform):
|
||||||
"TimeField, or DurationField."
|
"TimeField, or DurationField."
|
||||||
)
|
)
|
||||||
# Passing dates to functions expecting datetimes is most likely a mistake.
|
# Passing dates to functions expecting datetimes is most likely a mistake.
|
||||||
if type(field) == DateField and copy.lookup_name in (
|
if type(field) is DateField and copy.lookup_name in (
|
||||||
"hour",
|
"hour",
|
||||||
"minute",
|
"minute",
|
||||||
"second",
|
"second",
|
||||||
|
@ -310,7 +310,7 @@ class TruncBase(TimezoneMixin, Transform):
|
||||||
has_explicit_output_field = (
|
has_explicit_output_field = (
|
||||||
class_output_field or field.__class__ is not copy.output_field.__class__
|
class_output_field or field.__class__ is not copy.output_field.__class__
|
||||||
)
|
)
|
||||||
if type(field) == DateField and (
|
if type(field) is DateField and (
|
||||||
isinstance(output_field, DateTimeField)
|
isinstance(output_field, DateTimeField)
|
||||||
or copy.kind in ("hour", "minute", "second", "time")
|
or copy.kind in ("hour", "minute", "second", "time")
|
||||||
):
|
):
|
||||||
|
|
|
@ -242,7 +242,7 @@ class SchemaTests(TransactionTestCase):
|
||||||
"SELECT {} FROM {};".format(field_name, model._meta.db_table)
|
"SELECT {} FROM {};".format(field_name, model._meta.db_table)
|
||||||
)
|
)
|
||||||
database_default = cursor.fetchall()[0][0]
|
database_default = cursor.fetchall()[0][0]
|
||||||
if cast_function and type(database_default) != type(expected_default):
|
if cast_function and type(database_default) is not type(expected_default):
|
||||||
database_default = cast_function(database_default)
|
database_default = cast_function(database_default)
|
||||||
self.assertEqual(database_default, expected_default)
|
self.assertEqual(database_default, expected_default)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue