Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

BAU: Use urlencode instead of quote #210

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions api/magic_links/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,16 @@ def use(self, link_id: str):
# else if no link exists (or it has been used)
# but the user is already logged in
# then redirect them to the global redirect url
query_params = {
"fund": fund_short_name,
"round": round_short_name,
}
query_params = {
k: v for k, v in query_params.items() if v is not None
}
query_string = urllib.parse.urlencode(query_params)
frontend_account_url = (
f"{Config.MAGIC_LINK_REDIRECT_URL}"
f"?fund={urllib.parse.quote(fund_short_name) if fund_short_name else ''}"
f"&round={urllib.parse.quote(round_short_name) if round_short_name else ''}"
f"{Config.MAGIC_LINK_REDIRECT_URL}?{query_string}"
)
current_app.logger.warn(
f"The magic link with hash: '{link_hash}' has already been"
Expand Down
Loading