Skip to content

Commit

Permalink
Fail on startup if an invalid language code is the default locale
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelm committed Jan 3, 2024
1 parent a8893bd commit abe45bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pretix/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
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

Expand Down Expand Up @@ -495,6 +496,11 @@
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'
Expand Down

0 comments on commit abe45bc

Please sign in to comment.