Projet

Général

Profil

0001-notifications-add-settings-for-default-duration-2273.patch

Frédéric Péters, 22 mars 2018 10:35

Télécharger (1,73 ko)

Voir les différences:

Subject: [PATCH] notifications: add settings for default duration (#22730)

 combo/apps/notifications/models.py | 6 ++++--
 combo/settings.py                  | 3 +++
 2 files changed, 7 insertions(+), 2 deletions(-)
combo/apps/notifications/models.py
104 104
        '''
105 105
        start_timestamp = start_timestamp or now()
106 106

  
107
        if duration:
107
        if end_timestamp:
108
            pass
109
        elif duration:
108 110
            if not isinstance(duration, timedelta):
109 111
                duration = timedelta(seconds=duration)
110 112
            end_timestamp = start_timestamp + duration
111 113
        else:
112
            end_timestamp = end_timestamp or start_timestamp + timedelta(days=3)
114
            end_timestamp = start_timestamp + timedelta(days=settings.COMBO_DEFAULT_NOTIFICATION_DURATION)
113 115

  
114 116
        defaults = {
115 117
            'summary': summary,
combo/settings.py
298 298
# we use 28s by default: timeout just before web server, which is usually 30s
299 299
REQUESTS_TIMEOUT = 28
300 300

  
301
# default duration of notifications (in days)
302
COMBO_DEFAULT_NOTIFICATION_DURATION = 3
303

  
301 304
# hide work-in-progress/experimental/whatever cells for now
302 305
BOOKING_CALENDAR_CELL_ENABLED = False
303 306
NEWSLETTERS_CELL_ENABLED = False
304
-