From c7d5b687f30fbdfa31deb378b2fc48d0ecb41610 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 26 Oct 2022 09:18:19 +0200 Subject: [PATCH] Bump django-countries to 7.4.* --- src/pretix/helpers/countries.py | 19 +------------------ src/setup.py | 2 +- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/pretix/helpers/countries.py b/src/pretix/helpers/countries.py index ff97e76bc5..56bd8c4dcc 100644 --- a/src/pretix/helpers/countries.py +++ b/src/pretix/helpers/countries.py @@ -23,8 +23,7 @@ import pyuca from babel.core import Locale from django.core.cache import cache from django.utils import translation -from django.utils.encoding import force_str -from django_countries import Countries, CountryTuple +from django_countries import Countries from django_countries.fields import CountryField from phonenumbers.data import _COUNTRY_CODE_TO_REGION_CODE @@ -61,22 +60,6 @@ class CachedCountries(Countries): cache.set(cache_key, val, 3600 * 24 * 30) yield from val - def translate_pair(self, code: str, name=None): - # We need to temporarily override this function until - # https://github.com/SmileyChris/django-countries/issues/364 - # is fixed - if name is None: - name = self.countries[code] - if isinstance(name, dict): - if "names" in name: - country_name: str = name["names"][0] - else: - country_name = name["name"] - else: - country_name = name - country_name = force_str(country_name) - return CountryTuple(code, country_name) - class FastCountryField(CountryField): def __init__(self, *args, **kwargs): diff --git a/src/setup.py b/src/setup.py index c0e9a295f9..38779dbb00 100644 --- a/src/setup.py +++ b/src/setup.py @@ -171,7 +171,7 @@ setup( 'Django==3.2.*', 'django-bootstrap3==22.1.*', 'django-compressor==4.1.*', - 'django-countries==7.3.*', + 'django-countries==7.4.*', 'django-filter==21.1', 'django-formset-js-improved==0.5.0.2', 'django-formtools==2.3',