From c1b80a1707ff85df15e48a6891f1e92aacc28add Mon Sep 17 00:00:00 2001 From: Wille Marcel Date: Fri, 26 Jun 2020 11:01:00 -0300 Subject: [PATCH] fix user links on notification messages --- backend/services/messaging/message_service.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/services/messaging/message_service.py b/backend/services/messaging/message_service.py index a17a068032..f391d0b050 100644 --- a/backend/services/messaging/message_service.py +++ b/backend/services/messaging/message_service.py @@ -225,7 +225,7 @@ def send_request_to_join_team( message.from_user_id = from_user message.to_user_id = to_user message.subject = "Request to join team" - message.message = f'{from_username}\ + message.message = f'{from_username}\ has requested to join the {team_name} team' message.add_message() message.save() @@ -234,12 +234,13 @@ def send_request_to_join_team( def accept_reject_request_to_join_team( from_user: int, from_username: str, to_user: int, team_name: str, response: str ) -> Message: + base_url = current_app.config["APP_BASE_URL"] message = Message() message.message_type = MessageType.REQUEST_TEAM_NOTIFICATION.value message.from_user_id = from_user message.to_user_id = to_user message.subject = "Request to join team" - message.message = f'{from_username}\ + message.message = f'{from_username}\ has {response}ed your request to join the {team_name} team' message.add_message() message.save() @@ -253,12 +254,13 @@ def accept_reject_invitation_request_for_team( team_name: str, response: str, ) -> Message: + base_url = current_app.config["APP_BASE_URL"] message = Message() message.message_type = MessageType.INVITATION_NOTIFICATION.value message.from_user_id = from_user message.to_user_id = to_user message.subject = "Request to join team" - message.message = f'{from_username}\ + message.message = f'{from_username}\ has {response}ed {sending_member}\'s invitation to join the {team_name} team' message.add_message() message.save() @@ -267,12 +269,13 @@ def accept_reject_invitation_request_for_team( def send_invite_to_join_team( from_user: int, from_username: str, to_user: int, team_name: str ) -> Message: + base_url = current_app.config["APP_BASE_URL"] message = Message() message.message_type = MessageType.INVITATION_NOTIFICATION.value message.from_user_id = from_user message.to_user_id = to_user message.subject = "Invitation to join the team" - message.message = f'{from_username}\ + message.message = f'{from_username}\ has invited you to join the {team_name} team' message.add_message() message.save()