forked from CGM_Public/pretix_original
@@ -76,7 +76,7 @@ from pretix.base.validators import multimail_validate
|
|||||||
from pretix.control.forms import (
|
from pretix.control.forms import (
|
||||||
ExtFileField, FontSelect, MultipleLanguagesWidget, SingleLanguageWidget,
|
ExtFileField, FontSelect, MultipleLanguagesWidget, SingleLanguageWidget,
|
||||||
)
|
)
|
||||||
from pretix.helpers.countries import CachedCountries
|
from pretix.helpers.countries import CachedCountries, pycountry_add
|
||||||
|
|
||||||
ROUNDING_MODES = (
|
ROUNDING_MODES = (
|
||||||
('line', _('Compute taxes for every line individually')),
|
('line', _('Compute taxes for every line individually')),
|
||||||
@@ -3936,7 +3936,7 @@ COUNTRIES_WITH_STATE_IN_ADDRESS = {
|
|||||||
'MX': (['State', 'Federal district', 'Federal entity'], 'short'),
|
'MX': (['State', 'Federal district', 'Federal entity'], 'short'),
|
||||||
'US': (['State', 'Outlying area', 'District'], 'short'),
|
'US': (['State', 'Outlying area', 'District'], 'short'),
|
||||||
'IT': (['Province', 'Free municipal consortium', 'Metropolitan city', 'Autonomous province',
|
'IT': (['Province', 'Free municipal consortium', 'Metropolitan city', 'Autonomous province',
|
||||||
'Free municipal consortium', 'Decentralized regional entity'], 'short'),
|
'Decentralized regional entity'], 'short'),
|
||||||
}
|
}
|
||||||
COUNTRY_STATE_LABEL = {
|
COUNTRY_STATE_LABEL = {
|
||||||
# Countries in which the "State" field should not be called "State"
|
# Countries in which the "State" field should not be called "State"
|
||||||
@@ -3944,6 +3944,8 @@ COUNTRY_STATE_LABEL = {
|
|||||||
'JP': pgettext_lazy('address', 'Prefecture'),
|
'JP': pgettext_lazy('address', 'Prefecture'),
|
||||||
'IT': pgettext_lazy('address', 'Province'),
|
'IT': pgettext_lazy('address', 'Province'),
|
||||||
}
|
}
|
||||||
|
# Workaround for https://github.com/pretix/pretix/issues/5796
|
||||||
|
pycountry_add(pycountry.subdivisions, code="IT-AO", country_code="IT", name="Valle d'Aosta", parent="23", parent_code="IT-23", type="Province")
|
||||||
|
|
||||||
settings_hierarkey = Hierarkey(attribute_name='settings')
|
settings_hierarkey = Hierarkey(attribute_name='settings')
|
||||||
|
|
||||||
|
|||||||
@@ -136,3 +136,16 @@ custom_translations = [
|
|||||||
gettext_noop("North Macedonia"),
|
gettext_noop("North Macedonia"),
|
||||||
gettext_noop("Macao"),
|
gettext_noop("Macao"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def pycountry_add(db, **kw):
|
||||||
|
# Workaround for https://github.com/pycountry/pycountry/issues/281
|
||||||
|
db._load()
|
||||||
|
obj = db.factory(**kw)
|
||||||
|
db.objects.append(obj)
|
||||||
|
for key, value in kw.items():
|
||||||
|
if key in db.no_index:
|
||||||
|
continue
|
||||||
|
value = value.lower()
|
||||||
|
index = db.indices.setdefault(key, {})
|
||||||
|
index.setdefault(value, set()).add(obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user