From b30e43e8037bf075b6e2185c95e4fe08d49497a4 Mon Sep 17 00:00:00 2001 From: Shashank Verma Date: Thu, 5 Oct 2023 13:35:47 +0530 Subject: [PATCH] home: dashboard: mail_template: Fix links for prod Signed-off-by: Shashank Verma --- .../dashboard/mail_template_request_issue_assignment.html | 6 +++--- .../dashboard/mail_template_submit_pr_request.html | 6 +++--- home/views.py | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/home/templates/dashboard/mail_template_request_issue_assignment.html b/home/templates/dashboard/mail_template_request_issue_assignment.html index 275e4d6..47cceb2 100644 --- a/home/templates/dashboard/mail_template_request_issue_assignment.html +++ b/home/templates/dashboard/mail_template_request_issue_assignment.html @@ -4,7 +4,7 @@ 'user': email_context.user.username, 'url': email_context.url, 'protocol': , - 'host': request.get_host() + 'host': email_context.host } {% endcomment %} {% autoescape off %} @@ -12,8 +12,8 @@ Hi there! {{ mentor }},

PFB the details of the issue requested for assignment.

-Your Profile: {{ protocol }}://{{ host }}/profile/user/{{ mentor }}

-Requester's Profile: {{ protocol }}://{{ host }}/profile/user/{{ user }}

+Your Profile: {{ protocol }}://{{ host }}profile/user/{{ mentor }}

+Requester's Profile: {{ protocol }}://{{ host }}profile/user/{{ user }}

See Issue on Github: {{ url }}

If clicking on any of the link above doesn't work, please copy and paste the URL in a new browser diff --git a/home/templates/dashboard/mail_template_submit_pr_request.html b/home/templates/dashboard/mail_template_submit_pr_request.html index 1471280..ecf6ddd 100644 --- a/home/templates/dashboard/mail_template_submit_pr_request.html +++ b/home/templates/dashboard/mail_template_submit_pr_request.html @@ -4,7 +4,7 @@ 'user': email_context.user.username, 'url': url, 'protocol': , - 'host': request.get_host() + 'host': email_context.host } {% endcomment %} {% autoescape off %} @@ -12,8 +12,8 @@ Hi there! {{ mentor }},

{{ user }} has requested for approval of the PR on a issue that you are mentoring.

-Your Profile: {{ protocol }}://{{ host }}/profile/user/{{ mentor }}

-Contributor's Profile: {{ protocol }}://{{ host }}/profile/user/{{ user }}

+Your Profile: {{ protocol }}://{{ host }}profile/user/{{ mentor }}

+Contributor's Profile: {{ protocol }}://{{ host }}profile/user/{{ user }}

See PR on Github: {{ url }}

If clicking on any of the link above doesn't work, please copy and paste the URL in a new browser diff --git a/home/views.py b/home/views.py index fb5adbe..88d9193 100644 --- a/home/views.py +++ b/home/views.py @@ -1,3 +1,5 @@ +import decouple + from django.shortcuts import render, HttpResponseRedirect, reverse, HttpResponse, redirect from django.core.mail import send_mail, BadHeaderError @@ -122,7 +124,7 @@ def request_issue_assignment(request, issue_pk): 'user': requester, 'url': issue.html_url, 'protocol': request.build_absolute_uri().split('://')[0], - 'host': request.get_host(), + 'host': request.get_host() + '/' + decouple.config('BASE_URL', default=''), 'subject': "Request for Issue Assignment under ContriHUB-22.", 'issue': issue, 'action': '', @@ -209,7 +211,7 @@ def submit_pr_request(request, active_issue_pk): 'user': contributor, 'url': pr.pr_link, 'protocol': request.build_absolute_uri().split('://')[0], - 'host': request.get_host(), + 'host': request.get_host() + '/' + decouple.config('BASE_URL', default=''), 'issue': issue, 'action': '', 'subject': "Request for Approval of PR on an issue under ContriHUB-22.",