From dbdcb8cbebb095d7d6f97cff0027bd8ad0352e37 Mon Sep 17 00:00:00 2001 From: pederhan Date: Tue, 23 Apr 2024 12:34:07 +0200 Subject: [PATCH] Use old-style unions --- mreg_cli/api/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mreg_cli/api/models.py b/mreg_cli/api/models.py index 86071637..a6d1a712 100644 --- a/mreg_cli/api/models.py +++ b/mreg_cli/api/models.py @@ -299,7 +299,7 @@ class IPAddress(FrozenModelWithTimestamps, WithHost, APIMixin["IPAddress"]): @field_validator("macaddress", mode="before") @classmethod - def create_valid_macadress_or_none(cls, v: str) -> MACAddressField | None: + def create_valid_macadress_or_none(cls, v: str) -> Union[MACAddressField, None]: """Create macaddress or convert empty strings to None.""" if v: return MACAddressField(address=v) @@ -763,7 +763,7 @@ def validate_name(cls, value: str) -> HostT: @field_validator("comment", mode="before") @classmethod - def empty_string_to_none(cls, v: str) -> str | None: + def empty_string_to_none(cls, v: str) -> Union[str, None]: """Convert empty strings to None.""" return v or None