Skip to content

Commit

Permalink
Merge pull request #3216 from ckan/2842-config-object-fixes
Browse files Browse the repository at this point in the history
[#2842] config object fixes
  • Loading branch information
wardi committed Aug 30, 2016
2 parents 8d9e536 + 7483164 commit eb86250
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 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
2 changes: 1 addition & 1 deletion ckan/config/routing.py
Expand Up @@ -9,10 +9,10 @@
"""
import re

from pylons import config
from routes.mapper import SubMapper, Mapper as _Mapper

import ckan.plugins as p
from ckan.common import config

named_routes = {}

Expand Down
2 changes: 1 addition & 1 deletion ckan/lib/render.py
Expand Up @@ -4,7 +4,7 @@
import re
import logging

from pylons import config
from ckan.common import config

log = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion ckanext/example_theme/custom_config_setting/plugin.py
@@ -1,9 +1,9 @@
# encoding: utf-8

import pylons.config as config

import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckan.common import config


def show_most_popular_groups():
Expand Down
2 changes: 1 addition & 1 deletion ckanext/example_theme/custom_emails/tests.py
@@ -1,12 +1,12 @@
# encoding: utf-8

import os
from pylons import config
from ckan import plugins
import ckan.model as model
import ckan.lib.mailer as mailer
from ckan.tests import factories
from ckan.lib.base import render_jinja2
from ckan.common import config

from ckan.tests.lib.test_mailer import MailerBase
import ckan.tests.helpers as helpers
Expand Down
3 changes: 1 addition & 2 deletions ckanext/reclineview/plugin.py
Expand Up @@ -2,10 +2,9 @@

from logging import getLogger

from ckan.common import json
from ckan.common import json, config
import ckan.plugins as p
import ckan.plugins.toolkit as toolkit
from pylons import config

log = getLogger(__name__)
ignore_empty = p.toolkit.get_validator('ignore_empty')
Expand Down

0 comments on commit eb86250

Please sign in to comment.