Source code for shoop.front.apps.simple_order_notification.admin_module
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.template import engines
from django.template.utils import InvalidTemplateEngineError
from django.utils.translation import ugettext_lazy as _
from shoop.admin.base import AdminModule, Notification
[docs]class SimpleOrderNotificationModule(AdminModule):
name = _("Simple order notifications")
category = name
[docs] def get_notifications(self, request):
try:
engines["jinja2"]
except InvalidTemplateEngineError:
text = """Simple Order Notifications can't send order notifications
because it can't find a Jinja2 template engine. Name your Jinja2 template engine "jinja2" to resolve this."""
yield Notification(text=text)