1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-04 13:05:21 +02:00

fix: added validation to POSTGRES_URL_OVERRIDE

This commit is contained in:
Tarek Al-Qarqaz 2024-04-02 12:24:51 +00:00
parent a30084a199
commit cb7302d2d9

View file

@ -46,7 +46,11 @@ class PostgresProvider(AbstractDBProvider, BaseSettings):
@property
def db_url(self) -> str:
if self.POSTGRES_URL_OVERRIDE:
return self.POSTGRES_URL_OVERRIDE
url = PostgresDsn(url=self.POSTGRES_URL_OVERRIDE)
if not url.scheme == ("postgresql"):
raise ValueError("POSTGRES_URL_OVERRIDE scheme must be postgresql")
return str(url)
return str(
PostgresDsn.build(