8000 notifications: fix availability delay by PascalRepond · Pull Request #3491 · rero/rero-ils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

notifications: fix availability delay #3491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions rero_ils/modules/notifications/subclasses/availability.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
#
# RERO ILS
# Copyright (C) 2019-2022 RERO
# Copyright (C) 2019-2022 UCLouvain
# Copyright (C) 2019-2023 RERO
# Copyright (C) 2019-2023 UCLouvain
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
Expand Down Expand Up @@ -92,10 +92,11 @@ def get_notification_context(cls, notifications=None):
'delay': 0
}
# Availability notification could be sent with a delay. We need to find
# this delay into the library notifications settings.
# this delay into the library notifications settings and convert it
# from minutes to seconds.
for setting in library.get('notification_settings', []):
if setting['type'] == NotificationType.AVAILABILITY:
context['delay'] = setting.get('delay', 0)
context['delay'] = setting.get('delay', 0)*60
# Add metadata for any ``notification.loan`` of the notifications list
item_dumper = ItemNotificationDumper()
for notification in notifications:
Expand Down
0