Projet

Général

Profil

0001-lingo-make-it-possible-to-disable-notification-for-n.patch

Frédéric Péters, 21 mars 2018 11:57

Télécharger (1,9 ko)

Voir les différences:

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(+)
combo/apps/lingo/management/commands/notify_new_remote_invoices.py
18 18

  
19 19
import logging
20 20

  
21
from django.conf import settings
21 22
from django.core.management.base import BaseCommand
22 23

  
23 24
from combo.apps.lingo.models import Regie
......
26 27
class Command(BaseCommand):
27 28

  
28 29
    def handle(self, *args, **kwargs):
30
        if not settings.LINGO_INVOICE_NOTIFICATIONS_ENABLED:
31
            return
29 32
        logger = logging.getLogger(__name__)
30 33
        for regie in Regie.objects.exclude(webservice_url=''):
31 34
            try:
combo/settings.py
285 285
# default combo map attribution
286 286
COMBO_MAP_ATTRIBUTION = 'Map data &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
287 287

  
288
# send notifications about new invoices
289
LINGO_INVOICE_NOTIFICATIONS_ENABLED = True
290

  
288 291
# default delta, in days, for invoice remind notifications
289 292
LINGO_NEW_INVOICES_REMIND_DELTA = 7
290 293

  
291
-