Fix DB connection URL in env.py

Previously, this line was returning `***` as the DB password
This commit is contained in:
Daniel Seiler 2024-01-07 20:50:46 +01:00 committed by GitHub
parent 09096fe1c4
commit 3027534b16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,8 +22,8 @@ logger = logging.getLogger('alembic.env')
# target_metadata = mymodel.Base.metadata
config.set_main_option(
'sqlalchemy.url',
str(current_app.extensions['migrate'].db.get_engine().url).replace(
'%', '%%'))
current_app.config.get('SQLALCHEMY_DATABASE_URI')
)
target_metadata = current_app.extensions['migrate'].db.metadata
# other values from the config, defined by the needs of env.py,