1
0
mirror of https://github.com/ijaric/voice_assistant.git synced 2025-05-24 14:33:26 +00:00

fix: dsn password

This commit is contained in:
Artem Litvinov 2023-09-29 16:27:03 +01:00
parent 47d8745928
commit 70c9485d0f

View File

@ -27,7 +27,8 @@ class DBSettings(pydantic_settings.BaseSettings):
@property
def dsn(self) -> str:
return f"{self.protocol}://{self.user}:{self.password}@{self.host}:{self.port}"
password = self.password.get_secret_value() if isinstance(self.password, pydantic.SecretStr) else self.password
return f"{self.protocol}://{self.user}:{password}@{self.host}:{self.port}"
@property
def dsn_as_safe_url(self) -> str: