Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass along UTMs when doing a blog redirect #13381

Merged
merged 2 commits into from
Dec 6, 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
9 changes: 7 additions & 2 deletions webapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,10 +736,15 @@ def dispatch_request(self, slug):
if "article" not in context:
return flask.abort(404)

# Redirect canonical annoucements
# Redirect canonical announcements
group = context["article"].get("group")
if isinstance(group, dict) and group["id"] == 2100:
return flask.redirect(f"https://canonical.com/blog/{slug}")
redirect_url = f"https://canonical.com/blog/{slug}"
# Append the original query string to the redirect URL
original_query_string = flask.request.query_string.decode("utf-8")
if original_query_string:
redirect_url += f"?{original_query_string}"
return flask.redirect(redirect_url)

# Set blog notice date
blog_notice = {}
Expand Down
Loading