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

init_app should not reference self. #50

Open
nickelwound opened this issue Jan 22, 2020 · 1 comment
Open

init_app should not reference self. #50

nickelwound opened this issue Jan 22, 2020 · 1 comment

Comments

@nickelwound
Copy link

This line appears to break the following common pattern:

def create_app():
    """Bootstrap the app. Takes an instance of the Flask obj/app."""
    app = Flask(__name__)
    request_id = RequestID()
    request_id.init_app(app)
    return app

traceback:

    request_id.init_app(app)
  File "/usr/local/lib/python3.7/site-packages/flask_log_request_id/request_id.py", line 84, in init_app
    if self.app.config['LOG_REQUEST_ID_LOG_ALL_REQUESTS']:
AttributeError: 'NoneType' object has no attribute 'config'

When init_app is called, self.app has not been assigned. It should use the passed app object.

@arrdem
Copy link

arrdem commented Dec 31, 2020

Seems to have been fixed in #38 but not released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants