Skip to content

Commit

Permalink
Add library name to loan notifications. (#1721)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen authored Mar 11, 2024
1 parent 4912907 commit d991da1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/util/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ def send_loan_expiry_message(
edition = loan.license_pool.presentation_edition
identifier = loan.license_pool.identifier
library_short_name = loan.library.short_name
library_name = loan.library.name
title = f"Only {days_to_expiry} {'days' if days_to_expiry != 1 else 'day'} left on your loan!"
body = f"Your loan on {edition.title} is expiring soon"
body = f'Your loan for "{edition.title}" at {library_name} is expiring soon'
data = dict(
title=title,
body=body,
Expand Down
2 changes: 1 addition & 1 deletion tests/core/util/test_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_send_loan_notification(self, push_notf_fixture: PushNotificationsFixtur
),
"data": dict(
title="Only 1 day left on your loan!",
body=f"Your loan on {work.presentation_edition.title} is expiring soon",
body=f'Your loan for "{work.presentation_edition.title}" at {loan.library.name} is expiring soon',
event_type=NotificationConstants.LOAN_EXPIRY_TYPE,
loans_endpoint="http://localhost/default/loans",
external_identifier=patron.external_identifier,
Expand Down

0 comments on commit d991da1

Please sign in to comment.