Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion web/pgadmin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,15 @@ def run_migration_for_others():
run_migration_for_sqlite()

# Delete all the adhoc(temporary) servers from the pgAdmin database.
delete_adhoc_servers()
# Adhoc servers are created by interactive tools (Schema Diff,
# Query Tool ad-hoc connections, etc.) — they have no meaning
# in CLI sessions (`setup.py update-user`, etc.) and accessing
# `current_user` inside the user-scoped cleanup branch would
# fail with `AttributeError: 'PgAdmin' object has no attribute
# 'login_manager'` because Flask-Security has not yet been
# initialised at this point in create_app.
if not cli_mode:
delete_adhoc_servers()

Mail(app)

Expand Down
Loading