Skip to content

Commit

Permalink
notifications: fix at_desk delay
Browse files Browse the repository at this point in the history
* The delay for at_desk notification is set in minutes in the ui/data
but must be passed in seconds to the dispatcher.
* Closes rero#3467.

Co-Authored-by: Pascal Repond <pascal.repond@rero.ch>
  • Loading branch information
PascalRepond committed Oct 17, 2023
1 parent 36fe99e commit 1d79ac7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rero_ils/modules/notifications/subclasses/availability.py
Original file line number Diff line number Diff line change
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 comments on commit 1d79ac7

Please sign in to comment.