From 68389b29f2e40de8031742238f1a2f0529709f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 21 Mar 2018 11:54:11 +0100 Subject: [PATCH] lingo: make it possible to disable notification for new invoices (#22531) --- combo/apps/lingo/management/commands/notify_new_remote_invoices.py | 3 +++ combo/settings.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/combo/apps/lingo/management/commands/notify_new_remote_invoices.py b/combo/apps/lingo/management/commands/notify_new_remote_invoices.py index bdad803..7c6c262 100644 --- a/combo/apps/lingo/management/commands/notify_new_remote_invoices.py +++ b/combo/apps/lingo/management/commands/notify_new_remote_invoices.py @@ -18,6 +18,7 @@ import logging +from django.conf import settings from django.core.management.base import BaseCommand from combo.apps.lingo.models import Regie @@ -26,6 +27,8 @@ from combo.apps.lingo.models import Regie class Command(BaseCommand): def handle(self, *args, **kwargs): + if not settings.LINGO_INVOICE_NOTIFICATIONS_ENABLED: + return logger = logging.getLogger(__name__) for regie in Regie.objects.exclude(webservice_url=''): try: diff --git a/combo/settings.py b/combo/settings.py index a7b4738..22d064c 100644 --- a/combo/settings.py +++ b/combo/settings.py @@ -285,6 +285,9 @@ COMBO_MAP_TILE_URLTEMPLATE = 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png # default combo map attribution COMBO_MAP_ATTRIBUTION = 'Map data © OpenStreetMap contributors, CC-BY-SA' +# send notifications about new invoices +LINGO_INVOICE_NOTIFICATIONS_ENABLED = True + # default delta, in days, for invoice remind notifications LINGO_NEW_INVOICES_REMIND_DELTA = 7 -- 2.16.2