| 1 |
========================== |
| 2 |
Django 4.2.1 release notes |
| 3 |
========================== |
| 4 |
|
| 5 |
*May 3, 2023* |
| 6 |
|
| 7 |
Django 4.2.1 fixes a security issue with severity "low" and several bugs in |
| 8 |
4.2. |
| 9 |
|
| 10 |
CVE-2023-31047: Potential bypass of validation when uploading multiple files using one form field |
| 11 |
================================================================================================= |
| 12 |
|
| 13 |
Uploading multiple files using one form field has never been supported by |
| 14 |
:class:`.forms.FileField` or :class:`.forms.ImageField` as only the last |
| 15 |
uploaded file was validated. Unfortunately, :ref:`uploading_multiple_files` |
| 16 |
topic suggested otherwise. |
| 17 |
|
| 18 |
In order to avoid the vulnerability, :class:`~django.forms.ClearableFileInput` |
| 19 |
and :class:`~django.forms.FileInput` form widgets now raise ``ValueError`` when |
| 20 |
the ``multiple`` HTML attribute is set on them. To prevent the exception and |
| 21 |
keep the old behavior, set ``allow_multiple_selected`` to ``True``. |
| 22 |
|
| 23 |
For more details on using the new attribute and handling of multiple files |
| 24 |
through a single field, see :ref:`uploading_multiple_files`. |
| 25 |
|
| 26 |
Bugfixes |
| 27 |
======== |
| 28 |
|
| 29 |
* Fixed a regression in Django 4.2 that caused a crash of ``QuerySet.defer()`` |
| 30 |
when deferring fields by attribute names (:ticket:`34458`). |
| 31 |
|
| 32 |
* Fixed a regression in Django 4.2 that caused a crash of |
| 33 |
:class:`~django.contrib.postgres.search.SearchVector` function with ``%`` |
| 34 |
characters (:ticket:`34459`). |
| 35 |
|
| 36 |
* Fixed a regression in Django 4.2 that caused aggregation over query that |
| 37 |
uses explicit grouping to group against the wrong columns (:ticket:`34464`). |
| 38 |
|
| 39 |
* Reallowed, following a regression in Django 4.2, setting the |
| 40 |
``"cursor_factory"`` option in :setting:`OPTIONS` on PostgreSQL |
| 41 |
(:ticket:`34466`). |
| 42 |
|
| 43 |
* Enforced UTF-8 client encoding on PostgreSQL, following a regression in |
| 44 |
Django 4.2 (:ticket:`34470`). |
| 45 |
|
| 46 |
* Fixed a regression in Django 4.2 where ``i18n_patterns()`` didn't respect the |
| 47 |
``prefix_default_language`` argument when a fallback language of the default |
| 48 |
language was used (:ticket:`34455`). |
| 49 |
|
| 50 |
* Fixed a regression in Django 4.2 where translated URLs of the default |
| 51 |
language from ``i18n_patterns()`` with ``prefix_default_language`` set to |
| 52 |
``False`` raised 404 errors for a request with a different language |
| 53 |
(:ticket:`34515`). |
| 54 |
|
| 55 |
* Fixed a regression in Django 4.2 where creating copies and deep copies of |
| 56 |
``HttpRequest``, ``HttpResponse``, and their subclasses didn't always work |
| 57 |
correctly (:ticket:`34482`, :ticket:`34484`). |
| 58 |
|
| 59 |
* Fixed a regression in Django 4.2 where ``timesince`` and ``timeuntil`` |
| 60 |
template filters returned incorrect results for a datetime with a non-UTC |
| 61 |
timezone when a time difference is less than 1 day (:ticket:`34483`). |
| 62 |
|
| 63 |
* Fixed a regression in Django 4.2 that caused a crash of |
| 64 |
:class:`~django.contrib.postgres.search.SearchHeadline` function with |
| 65 |
``psycopg`` 3 (:ticket:`34486`). |
| 66 |
|
| 67 |
* Fixed a regression in Django 4.2 that caused incorrect ``ClearableFileInput`` |
| 68 |
margins in the admin (:ticket:`34506`). |
| 69 |
|
| 70 |
* Fixed a regression in Django 4.2 where breadcrumbs didn't appear on admin |
| 71 |
site app index views (:ticket:`34512`). |
| 72 |
|
| 73 |
* Made squashing migrations reduce ``AddIndex``, ``RemoveIndex``, |
| 74 |
``RenameIndex``, and ``CreateModel`` operations which allows removing a |
| 75 |
deprecated ``Meta.index_together`` option from historical migrations and use |
| 76 |
``Meta.indexes`` instead (:ticket:`34525`). |