mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
confirmation: Call get_link_for_object with host=unused when host unused.
This commit is contained in:
@@ -37,7 +37,7 @@ def unsubscribe_token(user_profile):
|
|||||||
# type: (UserProfile) -> Text
|
# type: (UserProfile) -> Text
|
||||||
# Leverage the Django confirmations framework to generate and track unique
|
# Leverage the Django confirmations framework to generate and track unique
|
||||||
# unsubscription tokens.
|
# 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):
|
def one_click_unsubscribe_link(user_profile, endpoint):
|
||||||
# type: (UserProfile, Text) -> Text
|
# type: (UserProfile, Text) -> Text
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ def maybe_send_to_registration(request, email, full_name=''):
|
|||||||
request.get_host(),
|
request.get_host(),
|
||||||
"/",
|
"/",
|
||||||
# Split this so we only get the part after the /
|
# 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=',
|
'?full_name=',
|
||||||
# urllib does not handle Unicode, so coerece to encoded byte string
|
# urllib does not handle Unicode, so coerece to encoded byte string
|
||||||
# Explanation: http://stackoverflow.com/a/5605354/90777
|
# Explanation: http://stackoverflow.com/a/5605354/90777
|
||||||
|
|||||||
Reference in New Issue
Block a user