diff --git a/zerver/lib/notifications.py b/zerver/lib/notifications.py index e91a792aaf..5cb3a2fcb8 100644 --- a/zerver/lib/notifications.py +++ b/zerver/lib/notifications.py @@ -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 diff --git a/zerver/views/auth.py b/zerver/views/auth.py index 8d3e505426..d2cf9adc8b 100644 --- a/zerver/views/auth.py +++ b/zerver/views/auth.py @@ -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