diff --git a/src/pretix/helpers/countries.py b/src/pretix/helpers/countries.py index 56bd8c4dcc..64c14d3e4f 100644 --- a/src/pretix/helpers/countries.py +++ b/src/pretix/helpers/countries.py @@ -19,18 +19,15 @@ # You should have received a copy of the GNU Affero General Public License along with this program. If not, see # . # -import pyuca from babel.core import Locale from django.core.cache import cache from django.utils import translation -from django_countries import Countries +from django_countries import Countries, collator from django_countries.fields import CountryField from phonenumbers.data import _COUNTRY_CODE_TO_REGION_CODE from pretix.base.i18n import get_babel_locale, get_language_without_region -_collator = pyuca.Collator() - class CachedCountries(Countries): _cached_lists = {} @@ -116,7 +113,7 @@ def get_phone_prefixes_sorted_and_localized(): if country_name: val.append((prefix, "{} {}".format(country_name, prefix))) - val = sorted(val, key=lambda item: _collator.sort_key(item[1])) + val = sorted(val, key=lambda item: collator.sort_key(item[1])) _cached_phone_prefixes[cache_key] = val cache.set(cache_key, val, 3600 * 24 * 30)