Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show errors on multiple instances or missing init #1151

Merged
merged 1 commit into from Dec 28, 2022
Merged

Conversation

davidism
Copy link
Member

Show an error for an invalid pattern which worked by accident but stopped in version 3. The user creates multiple extension instances, usually in different modules or during tests, rather than importing a single instance. If they fail to call init_app on one, the extension can't find the app in its engine registry. Or if they call init_app on both they can end up with conflicting sessions.

@davidism davidism added this to the 3.0.3 milestone Dec 28, 2022
@davidism davidism changed the base branch from main to 3.0.x December 28, 2022 22:55
@davidism davidism merged commit cfb61e1 into 3.0.x Dec 28, 2022
@davidism davidism deleted the instance-errors branch December 28, 2022 22:55
cjmayo added a commit to cjmayo/flask-admin that referenced this pull request Jan 28, 2023
cjmayo added a commit to cjmayo/flask-admin that referenced this pull request Jan 28, 2023
cjmayo added a commit to cjmayo/flask-admin that referenced this pull request Jan 28, 2023
As described in:

https://flask-sqlalchemy.palletsprojects.com/en/3.0.x/quickstart/#configure-the-extension

Was only working by accident prior to Flask-SQLAlchemy 3:

pallets-eco/flask-sqlalchemy#1151

Revealed problem with geoa tests creating tables twice outside of an
application context.
cjmayo added a commit to cjmayo/flask-admin that referenced this pull request Jan 30, 2023
As described in:

https://flask-sqlalchemy.palletsprojects.com/en/3.0.x/quickstart/#configure-the-extension

Was only working by accident prior to Flask-SQLAlchemy 3:

pallets-eco/flask-sqlalchemy#1151

Revealed that geoa tests were creating tables twice outside of an
application context.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant