Skip to content

Commit

Permalink
[#2842] Update the main CKAN config object with the Flask specific keys
Browse files Browse the repository at this point in the history
These were autogenerated or set during `make_flask_stack`, so they would
be lost when doing config.clear() (and updating with a previous copy, as
done extensively in the tests)
  • Loading branch information
amercader committed Aug 25, 2016
1 parent c0a997d commit f45f6ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ckan/config/middleware/flask_app.py
Expand Up @@ -32,6 +32,12 @@ def hello_world():
def hello_world_post():
return 'Hello World, this was posted to Flask'

# Update the main CKAN config object with the Flask specific keys
# that were set here or autogenerated
flask_config_keys = set(flask_app.config.keys()) - set(config.keys())
for key in flask_config_keys:
config[key] = flask_app.config[key]

# Add a reference to the actual Flask app so it's easier to access
app._wsgi_app = flask_app

Expand Down

0 comments on commit f45f6ff

Please sign in to comment.