Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

Add exemption for lang param in locale middleware. #55

Merged

Conversation

pmclanahan
Copy link

There may be some URLs which have other uses for a
'lang' query parameter. This allows you to set such URLs as exempt.

This is mostly for bedrock, as we need the /firefox/download/ page
to accept a ?lang= parameter that refers to the language of the
Fx build you wish to download. That param for that page has existed
for a long time and we're trying to port it from the PHP side
to bedrock.

@pmclanahan
Copy link
Author

@Osmose @jgmize r?

@@ -18,6 +18,9 @@
from .helpers import urlparams


EXEMPT_URLS = getattr(settings, 'FF_EXEMPT_LANG_PARAM_URLS', None)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would default this to an empty list instead of None here so you can always iterate through it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also wonder if s/URL/PATH/g would make more sense here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are just other settings that use URL. Figured it was more consistent.

@pmclanahan
Copy link
Author

If no one else has any objections I'm going to rebase and merge.

There may be some URLs which have other uses for a
'lang' query parameter. This allows you to set such
URLs as exempt.
@jgmize
Copy link
Contributor

jgmize commented Sep 13, 2013

r+

pmclanahan pushed a commit that referenced this pull request Sep 16, 2013
Add exemption for lang param in locale middleware.
@pmclanahan pmclanahan merged commit 31bd1b4 into mozilla:master Sep 16, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants