mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
redirects: Refactor redirect code to use central helper function.
This commit introduces two new functions in 'url_encoding.py' which centralize two common patterns for constructing redirect URLs. It also migrates the files using those patterns to use the new functions.
This commit is contained in:
committed by
Tim Abbott
parent
5dca599481
commit
2fe9d85a5f
@@ -97,3 +97,10 @@ def near_pm_message_url(realm: Realm,
|
||||
]
|
||||
full_url = '/'.join(parts)
|
||||
return full_url
|
||||
|
||||
def add_query_to_redirect_url(original_url: str, query: str) -> str:
|
||||
return original_url + "?" + query
|
||||
|
||||
def add_query_arg_to_redirect_url(original_url: str, query_arg: str) -> str:
|
||||
assert '?' in original_url
|
||||
return original_url + "&" + query_arg
|
||||
|
||||
Reference in New Issue
Block a user