fix: added https protocol in email unsubscribe url (#35087)

This commit is contained in:
Muhammad Adeel Tajamul
2024-07-04 16:29:22 +05:00
committed by GitHub
parent a763fd80d2
commit 89a237bec1

View File

@@ -76,7 +76,10 @@ def get_unsubscribe_link(username, patch):
'patch': encrypted_patch
}
relative_url = reverse('preference_update_from_encrypted_username_view', kwargs=kwargs)
return f"{settings.LMS_BASE}{relative_url}"
protocol = 'https://'
if settings.DEBUG:
protocol = 'http://'
return f"{protocol}{settings.LMS_BASE}{relative_url}"
def create_email_template_context(username):