May 3, 2023
Django 4.2.1 fixes a security issue with severity "low" and several bugs in 4.2.
Uploading multiple files using one form field has never been supported by
forms.FileField
or forms.ImageField
as only the last
uploaded file was validated. Unfortunately, 上传多个文件
topic suggested otherwise.
In order to avoid the vulnerability, ClearableFileInput
and FileInput
form widgets now raise ValueError
when
the multiple
HTML attribute is set on them. To prevent the exception and
keep the old behavior, set allow_multiple_selected
to True
.
For more details on using the new attribute and handling of multiple files through a single field, see 上传多个文件.
QuerySet.defer()
when deferring fields by attribute names (#34458).SearchVector
function with %
characters (#34459)."cursor_factory"
option in OPTIONS
on PostgreSQL
(#34466).i18n_patterns()
didn't respect the
prefix_default_language
argument when a fallback language of the default
language was used (#34455).i18n_patterns()
with prefix_default_language
set to
False
raised 404 errors for a request with a different language
(#34515).HttpRequest
, HttpResponse
, and their subclasses didn't always work
correctly (#34482, #34484).timesince
and timeuntil
template filters returned incorrect results for a datetime with a non-UTC
timezone when a time difference is less than 1 day (#34483).SearchHeadline
function with
psycopg
3 (#34486).ClearableFileInput
margins in the admin (#34506).AddIndex
, RemoveIndex
,
RenameIndex
, and CreateModel
operations which allows removing a
deprecated Meta.index_together
option from historical migrations and use
Meta.indexes
instead (#34525).5月 31, 2023