confirmation: Call get_link_for_object with host=unused when host unused.

This commit is contained in:
Rishi Gupta
2017-07-06 23:39:18 -07:00
committed by Tim Abbott
parent a4a654034c
commit c72a5f2efe
2 changed files with 2 additions and 2 deletions

View File

@@ -37,7 +37,7 @@ def unsubscribe_token(user_profile):
# type: (UserProfile) -> Text
# Leverage the Django confirmations framework to generate and track unique
# unsubscription tokens.
return Confirmation.objects.get_link_for_object(user_profile).split("/")[-1]
return Confirmation.objects.get_link_for_object(user_profile, host='unused').split("/")[-1]
def one_click_unsubscribe_link(user_profile, endpoint):
# type: (UserProfile, Text) -> Text

View File

@@ -65,7 +65,7 @@ def maybe_send_to_registration(request, email, full_name=''):
request.get_host(),
"/",
# Split this so we only get the part after the /
Confirmation.objects.get_link_for_object(prereg_user).split("/", 3)[3],
Confirmation.objects.get_link_for_object(prereg_user, host='unused').split("/", 3)[3],
'?full_name=',
# urllib does not handle Unicode, so coerece to encoded byte string
# Explanation: http://stackoverflow.com/a/5605354/90777