Skip to content

Commit 85bd3e0

Browse files
authored
Merge pull request #8494 from Couchers-org/backend/bugfix/host-request-push-nights
Backend/push: Tweak host request notif for clarity
2 parents e1d2123 + 9700fb9 commit 85bd3e0

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

app/backend/src/couchers/notifications/locales/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@
290290
"title": "New host request from {{user}}",
291291
"ios_title": "{{user}}",
292292
"ios_subtitle": "New Host Request",
293-
"body_one": "{{user}} wants to stay from {{start_date}} for {{count}} day.",
294-
"body_other": "{{user}} wants to stay from {{start_date}} for {{count}} days."
293+
"body_one": "{{user}} wants to stay from {{start_date}} for {{count}} night.",
294+
"body_other": "{{user}} wants to stay from {{start_date}} for {{count}} nights."
295295
}
296296
},
297297
"message": {

app/backend/src/couchers/notifications/render_push.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,14 +509,14 @@ def _render_general__new_blog_post(
509509
def _render_host_request__create(
510510
data: notification_data_pb2.HostRequestCreate, loc_context: LocalizationContext
511511
) -> PushNotificationContent:
512-
days = (date.fromisoformat(data.host_request.to_date) - date.fromisoformat(data.host_request.from_date)).days + 1
512+
night_count = (date.fromisoformat(data.host_request.to_date) - date.fromisoformat(data.host_request.from_date)).days
513513
return _get_content(
514514
NotificationTopicAction.host_request__create,
515515
loc_context,
516516
substitutions={
517517
"user": data.surfer.name,
518518
"start_date": loc_context.localize_date_from_iso(data.host_request.from_date),
519-
"count": days,
519+
"count": night_count,
520520
},
521521
icon_user=data.surfer,
522522
action_url=urls.host_request(host_request_id=data.host_request.host_request_id),

0 commit comments

Comments
 (0)