mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-06-23 15:31:37 -04:00
fix: added validation to POSTGRES_URL_OVERRIDE
This commit is contained in:
parent
a30084a199
commit
cb7302d2d9
@ -46,7 +46,11 @@ class PostgresProvider(AbstractDBProvider, BaseSettings):
|
|||||||
@property
|
@property
|
||||||
def db_url(self) -> str:
|
def db_url(self) -> str:
|
||||||
if self.POSTGRES_URL_OVERRIDE:
|
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(
|
return str(
|
||||||
PostgresDsn.build(
|
PostgresDsn.build(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user