forked from CGM_Public/pretix_original
Add region setting to supplement localization (#1875)
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
from django.core.cache import cache
|
||||
from django.utils.translation import get_language
|
||||
from django_countries import Countries
|
||||
from django_countries.fields import CountryField
|
||||
|
||||
from pretix.base.i18n import get_language_without_region
|
||||
|
||||
|
||||
class CachedCountries(Countries):
|
||||
_cached_lists = {}
|
||||
@@ -14,7 +15,7 @@ class CachedCountries(Countries):
|
||||
django-countries performs a unicode-aware sorting based on pyuca which is incredibly
|
||||
slow.
|
||||
"""
|
||||
cache_key = "countries:all:{}".format(get_language())
|
||||
cache_key = "countries:all:{}".format(get_language_without_region())
|
||||
if self.cache_subkey:
|
||||
cache_key += ":" + self.cache_subkey
|
||||
if cache_key in self._cached_lists:
|
||||
|
||||
Reference in New Issue
Block a user