File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 22
33## [ unreleased]
44
5+ ### Fixed
6+
7+ * database: Fixed special characters in password not being URL encoded.
8+
59### Performance
610
711* context: Do not reinitialize config when adding a single index.
Original file line number Diff line number Diff line change 3030from typing import TypeVar
3131from typing import Union
3232from typing import cast
33+ from urllib .parse import quote_plus
3334from urllib .parse import urlparse
3435
3536from pydantic import validator
@@ -120,7 +121,7 @@ class PostgresDatabaseConfig:
120121 def connection_string (self ) -> str :
121122 # NOTE: `maxsize=1` is important! Concurrency will be broken otherwise.
122123 # NOTE: https://github.com/tortoise/tortoise-orm/issues/792
123- connection_string = f'{ self .kind } ://{ self .user } :{ self .password } @{ self .host } :{ self .port } /{ self .database } ?maxsize=1'
124+ connection_string = f'{ self .kind } ://{ self .user } :{ quote_plus ( self .password ) } @{ self .host } :{ self .port } /{ self .database } ?maxsize=1'
124125 if self .schema_name != DEFAULT_POSTGRES_SCHEMA :
125126 connection_string += f'&schema={ self .schema_name } '
126127 return connection_string
You can’t perform that action at this time.
0 commit comments