Skip to content

Commit 6c72497

Browse files
author
Alexander Chernetsov
committed
add validator
1 parent 97003a1 commit 6c72497

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

overhave/entities/settings.py

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ class OverhaveAdminSettings(BaseOverhavePrefix):
3232
# Link to support chat
3333
support_chat_url: httpx.URL | None
3434

35+
@validator("support_chat_url", pre=True)
36+
def validate_url(cls, v: str | httpx.URL) -> httpx.URL:
37+
if isinstance(v, str):
38+
return httpx.URL(v)
39+
return v
40+
3541

3642
class OverhaveLanguageSettings(BaseOverhavePrefix):
3743
"""Settings for language definitions."""

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "overhave"
3-
version = "4.1.2"
3+
version = "4.1.3"
44
description = "Overhave - web-framework for BDD"
55
readme = "README.rst"
66
authors = [

0 commit comments

Comments
 (0)