From 6c449e30197e1695b8406bb1b8d8f9574ed3869c Mon Sep 17 00:00:00 2001 From: jo Date: Sat, 30 Jul 2022 21:11:45 +0200 Subject: [PATCH] fix(shared): validator value type can be wrong --- shared/libretime_shared/config/_models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shared/libretime_shared/config/_models.py b/shared/libretime_shared/config/_models.py index e4a2634ab..34750b212 100644 --- a/shared/libretime_shared/config/_models.py +++ b/shared/libretime_shared/config/_models.py @@ -9,8 +9,10 @@ if TYPE_CHECKING: def no_trailing_slash_validator(key: str) -> "AnyClassMethod": # pylint: disable=unused-argument - def strip_trailing_slash(cls: Any, value: str) -> str: - return value.rstrip("/") + def strip_trailing_slash(cls: Any, value: Any) -> Any: + if isinstance(value, str): + return value.rstrip("/") + return value return validator(key, pre=True, allow_reuse=True)(strip_trailing_slash)