notifications: add settings for default duration (#22730)
This commit is contained in:
parent
408711c09e
commit
a00a5358c4
|
@ -104,12 +104,14 @@ class Notification(models.Model):
|
|||
'''
|
||||
start_timestamp = start_timestamp or now()
|
||||
|
||||
if duration:
|
||||
if end_timestamp:
|
||||
pass
|
||||
elif duration:
|
||||
if not isinstance(duration, timedelta):
|
||||
duration = timedelta(seconds=duration)
|
||||
end_timestamp = start_timestamp + duration
|
||||
else:
|
||||
end_timestamp = end_timestamp or start_timestamp + timedelta(days=3)
|
||||
end_timestamp = start_timestamp + timedelta(days=settings.COMBO_DEFAULT_NOTIFICATION_DURATION)
|
||||
|
||||
defaults = {
|
||||
'summary': summary,
|
||||
|
|
|
@ -297,6 +297,9 @@ SITE_BASE_URL = 'http://localhost'
|
|||
# we use 28s by default: timeout just before web server, which is usually 30s
|
||||
REQUESTS_TIMEOUT = 28
|
||||
|
||||
# default duration of notifications (in days)
|
||||
COMBO_DEFAULT_NOTIFICATION_DURATION = 3
|
||||
|
||||
# hide work-in-progress/experimental/whatever cells for now
|
||||
BOOKING_CALENDAR_CELL_ENABLED = False
|
||||
NEWSLETTERS_CELL_ENABLED = False
|
||||
|
|
Loading…
Reference in New Issue