forked from CGM_Public/pretix_original
Fail on startup if an invalid language code is the default locale
This commit is contained in:
@@ -41,6 +41,7 @@ from json import loads
|
|||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
import importlib_metadata as metadata
|
import importlib_metadata as metadata
|
||||||
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
from django.utils.crypto import get_random_string
|
from django.utils.crypto import get_random_string
|
||||||
from kombu import Queue
|
from kombu import Queue
|
||||||
|
|
||||||
@@ -495,6 +496,11 @@ for k, v in ALL_LANGUAGES: # noqa
|
|||||||
continue
|
continue
|
||||||
LANGUAGES.append((k, v))
|
LANGUAGES.append((k, v))
|
||||||
|
|
||||||
|
if LANGUAGE_CODE not in {l[0] for l in LANGUAGES}:
|
||||||
|
raise ImproperlyConfigured(
|
||||||
|
f"Default language {LANGUAGE_CODE} is not one of the available and enabled languages."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
AUTH_USER_MODEL = 'pretixbase.User'
|
AUTH_USER_MODEL = 'pretixbase.User'
|
||||||
LOGIN_URL = 'control:auth.login'
|
LOGIN_URL = 'control:auth.login'
|
||||||
|
|||||||
Reference in New Issue
Block a user