From a585d97f9f67e410ecbfdcd1aed5c54075018f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:54:39 +0200 Subject: [PATCH] py3.12/refac: AfterValidator -> StringConstraints --- api/ovdashboard_api/core/calevent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/ovdashboard_api/core/calevent.py b/api/ovdashboard_api/core/calevent.py index f927099..337716c 100644 --- a/api/ovdashboard_api/core/calevent.py +++ b/api/ovdashboard_api/core/calevent.py @@ -9,11 +9,11 @@ from functools import total_ordering from logging import getLogger from typing import Annotated, Self -from pydantic import AfterValidator, BaseModel, ConfigDict +from pydantic import BaseModel, ConfigDict, StringConstraints from vobject.base import Component _logger = getLogger(__name__) -StrippedStr = Annotated[str, AfterValidator(lambda s: s.strip())] +type StrippedStr = Annotated[str, StringConstraints(strip_whitespace=True)] @total_ordering