Coverage for src/couchers/urls.py: 93%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# The source of truth for URLs is
2# //docs/urls.md
3# Please make sure this file stays in sync with that file as well as
4# //app/web/src/routes.ts
7from couchers.config import config
10def app_link():
11 return f"{config['BASE_URL']}/"
14def profile_link():
15 return f"{config['BASE_URL']}/profile"
18def user_link(*, username):
19 return f"{config['BASE_URL']}/user/{username}"
22def edit_profile_link():
23 return f"{config['BASE_URL']}/profile/edit"
26def signup_link(*, token):
27 return f"{config['BASE_URL']}/signup?token={token}"
30def login_link(*, login_token):
31 return f"{config['BASE_URL']}/login?token={login_token}"
34def account_settings_link():
35 return f"{config['BASE_URL']}/account-settings"
38def password_reset_link(*, password_reset_token):
39 return f"{config['BASE_URL']}/complete-password-reset?token={password_reset_token}"
42def host_request_link_host():
43 return f"{config['BASE_URL']}/messages/hosting/"
46def host_request_link_guest():
47 return f"{config['BASE_URL']}/messages/surfing/"
50def messages_link():
51 return f"{config['BASE_URL']}/messages/"
54def chat_link(*, chat_id):
55 return f"{config['BASE_URL']}/messages/chats/{chat_id}"
58def leave_reference_link(*, reference_type, to_user_id, host_request_id=None):
59 assert reference_type in ["friend", "surfed", "hosted"]
60 if host_request_id:
61 return f"{config['BASE_URL']}/leave-reference/{reference_type}/{to_user_id}/{host_request_id}"
62 else:
63 return f"{config['BASE_URL']}/leave-reference/{reference_type}/{to_user_id}"
66def friend_requests_link():
67 return f"{config['BASE_URL']}/connections/friends/"
70def media_upload_url(*, path):
71 return f"{config['MEDIA_SERVER_BASE_URL']}/{path}"
74def change_email_link(*, confirmation_token):
75 return f"{config['BASE_URL']}/confirm-email?token={confirmation_token}"
78def donation_cancelled_url():
79 return f"{config['BASE_URL']}/donate?cancelled=true"
82def donation_success_url():
83 return f"{config['BASE_URL']}/donate?success=true"
86def delete_account_link(*, account_deletion_token):
87 return f"{config['BASE_URL']}/delete-account?token={account_deletion_token}"
90def recover_account_link(*, account_undelete_token):
91 return f"{config['BASE_URL']}/recover-account?token={account_undelete_token}"
94def unsubscribe_link(*, payload, sig):
95 return f"{config['BASE_URL']}/unsubscribe?payload={payload}&sig={sig}"