fix: when redirecting to the MFE, preserve query flags

This can potentially fix analytics based on query params like
utm_campaign and the like. And generally seems like the correct
thing to do.

AA-1128
This commit is contained in:
Michael Terry
2021-12-07 13:48:04 -05:00
parent f1cc288189
commit bf2c2ce3c3
7 changed files with 53 additions and 11 deletions

View File

@@ -45,6 +45,8 @@ def learner_profile(request, username):
"""
if should_redirect_to_profile_microfrontend():
profile_microfrontend_url = f"{settings.PROFILE_MICROFRONTEND_URL}{username}"
if request.GET:
profile_microfrontend_url += f'?{request.GET.urlencode()}'
return redirect(profile_microfrontend_url)
try: