fix: replace Optional[X] type hints with X | None (UP045)

This commit is contained in:
Mike 2026-05-22 16:22:29 -07:00
parent 72ede7357b
commit 39b4a46cb8
2 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
from __future__ import annotations
import warnings
from typing import TYPE_CHECKING, Optional
from typing import TYPE_CHECKING
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
@ -163,7 +163,7 @@ class Attribute(models.Model):
:meth:`~eav.registry.EavConfig.get_attributes` method of that entity's config.
"""
enum_group: ForeignKey[Optional[EnumGroup]] = ForeignKey(
enum_group: ForeignKey[EnumGroup | None] = ForeignKey(
"eav.EnumGroup",
on_delete=models.PROTECT,
blank=True,

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar, Optional
from typing import TYPE_CHECKING, ClassVar
from django.contrib.contenttypes import fields as generic
from django.contrib.contenttypes.models import ContentType
@ -136,7 +136,7 @@ class Value(models.Model):
verbose_name=_("Value JSON"),
)
value_enum: ForeignKey[Optional[EnumValue]] = ForeignKey(
value_enum: ForeignKey[EnumValue | None] = ForeignKey(
"eav.EnumValue",
blank=True,
null=True,