mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Deprecated SortedDict (replaced with collections.OrderedDict)
Thanks Loic Bistuer for the review.
This commit is contained in:
committed by
Tim Graham
parent
b278f7478d
commit
07876cf02b
@@ -1,12 +1,13 @@
|
||||
"This is the locale selecting middleware that will look at accept headers"
|
||||
|
||||
from collections import OrderedDict
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import (is_valid_path, get_resolver,
|
||||
LocaleRegexURLResolver)
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.utils.cache import patch_vary_headers
|
||||
from django.utils import translation
|
||||
from django.utils.datastructures import SortedDict
|
||||
|
||||
|
||||
class LocaleMiddleware(object):
|
||||
@@ -19,7 +20,7 @@ class LocaleMiddleware(object):
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self._supported_languages = SortedDict(settings.LANGUAGES)
|
||||
self._supported_languages = OrderedDict(settings.LANGUAGES)
|
||||
self._is_language_prefix_patterns_used = False
|
||||
for url_pattern in get_resolver(None).url_patterns:
|
||||
if isinstance(url_pattern, LocaleRegexURLResolver):
|
||||
|
||||
Reference in New Issue
Block a user