Created
October 1, 2018 09:06
-
-
Save LowerDeez/e0980435b482e1f19dba9302d32c12c9 to your computer and use it in GitHub Desktop.
Django. Remove GET parameters with specific prefix from querystring
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qs = request.META.get('QUERY_STRING', '') | |
querystring = qs.split('&') | |
filtered_querystring = filter(lambda p: not p.split('=')[0].startswith('utm_'), querystring) | |
qs = '&'.join(filtered_querystring) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment