Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 23, 2025
1 parent 8d39d80 commit 840fdb6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions mypy_django_plugin/transformers/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,8 @@ def set_descriptor_types_for_field(
get_type = get_proper_type(helpers.convert_any_to_type(mapped_get_type, get_type))

# the get_type must be optional if the field is nullable
if (
(is_get_nullable or is_nullable)
and not (
isinstance(get_type, NoneType)
or helpers.is_optional(get_type)
or isinstance(get_type, AnyType)
)
if (is_get_nullable or is_nullable) and not (
isinstance(get_type, NoneType) or helpers.is_optional(get_type) or isinstance(get_type, AnyType)
):
ctx.api.fail(
f"{default_return_type.type.name} is nullable but its generic get type parameter is not optional",
Expand Down

0 comments on commit 840fdb6

Please sign in to comment.