Skip to content

Commit

Permalink
Fix path for Babel i18n and templates directories.
Browse files Browse the repository at this point in the history
Flask app creation moved into deeper directory heirarchy, but changing
location of root relative to the flask_app files was missed.
  • Loading branch information
brew committed Jun 7, 2016
1 parent dbbf803 commit 1f44524
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ckan/config/middleware/flask_app.py
Expand Up @@ -41,7 +41,8 @@ def make_flask_stack(conf, **app_conf):

debug = app_conf.get('debug', True)

root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
root = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
app = CKANFlask(__name__)
app.debug = debug
app.template_folder = os.path.join(root, 'templates')
Expand Down Expand Up @@ -103,8 +104,7 @@ def c_object():
return dict(c=c)

# Babel
app.config['BABEL_TRANSLATION_DIRECTORIES'] = os.path.join(
os.path.dirname(__file__), '..', 'i18n')
app.config['BABEL_TRANSLATION_DIRECTORIES'] = os.path.join(root, 'i18n')
app.config['BABEL_DOMAIN'] = 'ckan'

babel = Babel(app)
Expand Down
1 change: 0 additions & 1 deletion ckan/tests/config/test_sessions.py
Expand Up @@ -84,7 +84,6 @@ def get_blueprint(self):

# Create Blueprint for plugin
blueprint = Blueprint(self.name, self.__module__)
blueprint.template_folder = '../../templates'
# Add plugin url rules to Blueprint object
rules = [
('/flask_add_flash_message_redirect_to_flask', 'add_flash_message',
Expand Down

0 comments on commit 1f44524

Please sign in to comment.