1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

[5.1.x] Fixed #35627 -- Raised a LookupError rather than an unhandled ValueError in get_supported_language_variant().

LocaleMiddleware didn't handle the ValueError raised by
get_supported_language_variant() when language codes were
over 500 characters.

Regression in 9e9792228a.

Backport of 0e94f292cd from main.
This commit is contained in:
Lorenzo Peña
2024-07-23 12:06:29 +02:00
committed by Sarah Boyce
parent d9d77de2f6
commit 741f33eaf1
6 changed files with 31 additions and 7 deletions

View File

@@ -19,3 +19,7 @@ Bugfixes
* Fixed a crash when creating a model with a ``Field.db_default`` and a
``Meta.constraints`` constraint composed of ``__endswith``, ``__startswith``,
or ``__contains`` lookups (:ticket:`35625`).
* Fixed a regression in Django 5.0.7 that caused a crash in
``LocaleMiddleware`` when processing a language code over 500 characters
(:ticket:`35627`).