Skip to content

Commit

Permalink
Merge pull request hotosm#3216 from hotosm/fix/msg-user-link
Browse files Browse the repository at this point in the history
fix user links on notification messages
  • Loading branch information
ramyaragupathy authored Jun 26, 2020
2 parents c2cdd8a + c1b80a1 commit a675b62
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions backend/services/messaging/message_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'<a href="{base_url}/user/{from_username}">{from_username}\
message.message = f'<a href="{base_url}/users/{from_username}">{from_username}\
</a> has requested to join the {team_name} team'
message.add_message()
message.save()
Expand All @@ -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'<a href="http://127.0.0.1:5000/user/{from_username}">{from_username}\
message.message = f'<a href="{base_url}/users/{from_username}">{from_username}\
</a> has {response}ed your request to join the {team_name} team'
message.add_message()
message.save()
Expand All @@ -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'<a href="http://127.0.0.1:5000/user/{from_username}">{from_username}\
message.message = f'<a href="{base_url}/users/{from_username}">{from_username}\
</a> has {response}ed {sending_member}\'s invitation to join the {team_name} team'
message.add_message()
message.save()
Expand All @@ -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'<a href="http://127.0.0.1:5000/user/{from_username}">{from_username}\
message.message = f'<a href="{base_url}/users/{from_username}">{from_username}\
</a> has invited you to join the {team_name} team'
message.add_message()
message.save()
Expand Down

0 comments on commit a675b62

Please sign in to comment.