mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
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
|
||||
|
||||
import importlib_metadata as metadata
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.utils.crypto import get_random_string
|
||||
from kombu import Queue
|
||||
|
||||
@@ -495,6 +496,11 @@ for k, v in ALL_LANGUAGES: # noqa
|
||||
continue
|
||||
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'
|
||||
LOGIN_URL = 'control:auth.login'
|
||||
|
||||
Reference in New Issue
Block a user