fix: added validation to POSTGRES_URL_OVERRIDE
This commit is contained in:
1 parent
a30084a199
commit
cb7302d2d9
1 file changed
+5
-1
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user