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

Url tracking code mangling original url parameters. #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions emencia/django/newsletter/views/tracking.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Views for emencia.django.newsletter Tracking"""
import base64
from urllib import urlencode
from django.utils.http import urlencode
from urlparse import urlparse
from urlparse import urlunparse
# For Python < 2.6
Expand Down Expand Up @@ -53,9 +53,9 @@ def view_newsletter_tracking_link(request, slug, uidb36, token, link_id):
query_dict = parse_qs(url_parts.query)
query_dict.update({'utm_source': 'newsletter_%s' % newsletter.pk,
'utm_medium': 'mail',
'utm_campaign': smart_str(newsletter.title)})
'utm_campaign': newsletter.title})
url = urlunparse((url_parts.scheme, url_parts.netloc, url_parts.path,
url_parts.params, urlencode(query_dict), url_parts.fragment))
url_parts.params, urlencode(query_dict, True), url_parts.fragment))
return HttpResponseRedirect(url)


Expand Down