diff options
Diffstat (limited to 'mediagoblin/util.py')
-rw-r--r-- | mediagoblin/util.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mediagoblin/util.py b/mediagoblin/util.py index 91fbee0a..f0229300 100644 --- a/mediagoblin/util.py +++ b/mediagoblin/util.py @@ -32,6 +32,7 @@ from lxml.html.clean import Cleaner import markdown from mediagoblin import mg_globals +from mediagoblin import messages from mediagoblin.db.util import ObjectId TESTS_ENABLED = False @@ -104,6 +105,12 @@ def get_jinja_env(template_loader, locale): mg_globals.translations.gettext, mg_globals.translations.ngettext) + # All templates will know how to ... + # ... add a new message to the message queue + template_env.globals['add_message'] = messages.add_message + # ... fetch all waiting messages and remove them from the queue + template_env.globals['fetch_messages'] = messages.fetch_messages + if exists(locale): SETUP_JINJA_ENVS[locale] = template_env |