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

Alternate PR to #3970 #3997

Merged
merged 1 commit into from Dec 4, 2017
Merged

Conversation

mistercrunch
Copy link
Member

No description provided.

@john-bodley
Copy link
Member

LGTM

@mistercrunch mistercrunch merged commit eff5952 into apache:master Dec 4, 2017
@mistercrunch mistercrunch deleted the flask_app_mutator branch December 4, 2017 16:19
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
@mapto
Copy link

mapto commented Mar 22, 2019

I also need to add a before_request for #7024 to get session information from cookies. However, this PR does not seem to solve the problem: the intended use as per the provided example does not work.

FLASK_APP_MUTATOR = lambda x: x.before_request = f

results in a SyntaxError: can't assign to lambda with Python 3.6.8. Currently, assignments inside lambda are not supported in Python, and this is apparently going to change in Python 3.8.

A functional alternative to the example would be:

def attach_handler(app):
    app.before_request = f

FLASK_APP_MUTATOR = lambda app: attach_handler(app)

@mapto mapto mentioned this pull request Mar 29, 2019
@shawnzhu shawnzhu mentioned this pull request Aug 17, 2021
9 tasks
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.21.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.21.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants