urls: Rename arguments to accounts/unsubscribe.

type -> email_type to match future work on ScheduledJob.

token -> confirmation_key to match what the other confirmation views urls
call this argument.
This commit is contained in:
Rishi Gupta
2017-07-07 11:37:09 -07:00
committed by Tim Abbott
parent 11a4cffba0
commit 0f46fd86dd
3 changed files with 7 additions and 7 deletions

View File

@@ -39,14 +39,14 @@ def unsubscribe_token(user_profile):
# unsubscription tokens.
return Confirmation.objects.get_link_for_object(user_profile, 'unused').split("/")[-1]
def one_click_unsubscribe_link(user_profile, endpoint):
def one_click_unsubscribe_link(user_profile, email_type):
# type: (UserProfile, Text) -> Text
"""
Generate a unique link that a logged-out user can visit to unsubscribe from
Zulip e-mails without having to first log in.
"""
token = unsubscribe_token(user_profile)
resource_path = "accounts/unsubscribe/%s/%s" % (endpoint, token)
resource_path = "accounts/unsubscribe/%s/%s" % (email_type, token)
return "%s/%s" % (user_profile.realm.uri.rstrip("/"), resource_path)
def hash_util_encode(string):