mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-04 04:55:21 +02:00
removed try/catch
This commit is contained in:
parent
a384e6716d
commit
8db08c21e5
1 changed files with 4 additions and 17 deletions
|
@ -45,28 +45,15 @@ class PostgresProvider(AbstractDBProvider, BaseSettings):
|
||||||
@property
|
@property
|
||||||
def db_url(self) -> str:
|
def db_url(self) -> str:
|
||||||
host = f"{self.POSTGRES_SERVER}:{self.POSTGRES_PORT}"
|
host = f"{self.POSTGRES_SERVER}:{self.POSTGRES_PORT}"
|
||||||
try:
|
return str(
|
||||||
url = PostgresDsn.build(
|
PostgresDsn.build(
|
||||||
scheme="postgresql",
|
scheme="postgresql",
|
||||||
username=self.POSTGRES_USER,
|
username=self.POSTGRES_USER,
|
||||||
password=self.POSTGRES_PASSWORD,
|
password=urlparse.quote_plus(self.POSTGRES_PASSWORD),
|
||||||
host=host,
|
host=host,
|
||||||
path=f"{self.POSTGRES_DB or ''}",
|
path=f"{self.POSTGRES_DB or ''}",
|
||||||
)
|
)
|
||||||
except ValueError as outer_error:
|
)
|
||||||
try:
|
|
||||||
# if the password contains special characters, it needs to be URL encoded
|
|
||||||
url = PostgresDsn.build(
|
|
||||||
scheme="postgresql",
|
|
||||||
username=self.POSTGRES_USER,
|
|
||||||
password=urlparse.quote_plus(self.POSTGRES_PASSWORD),
|
|
||||||
host=host,
|
|
||||||
path=f"{self.POSTGRES_DB or ''}",
|
|
||||||
)
|
|
||||||
except Exception:
|
|
||||||
raise outer_error
|
|
||||||
|
|
||||||
return str(url)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def db_url_public(self) -> str:
|
def db_url_public(self) -> str:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue