aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gentoo_ads/ads/views.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/gentoo_ads/ads/views.py b/gentoo_ads/ads/views.py
index 261dffe..11489f4 100644
--- a/gentoo_ads/ads/views.py
+++ b/gentoo_ads/ads/views.py
@@ -25,9 +25,8 @@ def _build_lang_array(request):
#accept_langs = [_.strip() for _ in accept_langs_raw.split(',')]
#accept_langs = accept_langs_raw.split(',')
# Handle dialects
- for _ in accept_langs:
- if '-' in _:
- accept_langs += [ re.sub('[-_][_-a-zA-Z0-9]+', '', _) ]
+ accept_langs = [re.sub('[-_][_-a-zA-Z0-9]+', '', lang) for lang in accept_langs if '-' in lang]
+
return accept_langs
def _match_langs(accept_langs, available_langs):