Debian Codegraph @

docs/releases/5.2.1.txt

raw
1 ==========================
2 Django 5.2.1 release notes
3 ==========================
4
5 *May 7, 2025*
6
7 Django 5.2.1 fixes a security issue with severity "moderate" and several bugs
8 in 5.2.
9
10 This release was built using an upgraded :pypi:`setuptools`, producing
11 filenames compliant with :pep:`491` and :pep:`625` and thus addressing a PyPI
12 warning about non-compliant distribution filenames. This change only affects
13 the Django packaging process and does not impact Django's behavior.
14
15 CVE-2025-32873: Denial-of-service possibility in ``strip_tags()``
16 =================================================================
17
18 :func:`~django.utils.html.strip_tags` would be slow to evaluate certain inputs
19 containing large sequences of incomplete HTML tags. This function is used to
20 implement the :tfilter:`striptags` template filter, which was thus also
21 vulnerable.
22
23 :func:`~django.utils.html.strip_tags` now raises a :exc:`.SuspiciousOperation`
24 exception if it encounters an unusually large number of unclosed opening tags.
25
26 Bugfixes
27 ========
28
29 * Fixed a regression in Django 5.2 that caused a crash when annotating
30 aggregate expressions over query that uses explicit grouping by transforms
31 followed by field references (:ticket:`36292`).
32
33 * Fixed a regression in Django 5.2 that caused unnecessary queries when
34 prefetching nullable foreign key relationships (:ticket:`36290`).
35
36 * Fixed a regression in Django 5.2 that caused a crash of
37 ``QuerySet.bulk_create()`` with nullable geometry fields on PostGIS
38 (:ticket:`36289`).
39
40 * Fixed a regression in Django 5.2 that caused fields to be incorrectly
41 selected when using ``QuerySet.alias()`` after ``values()``
42 (:ticket:`36299`).
43
44 * Fixed a data corruption possibility in ``file_move_safe()`` when
45 ``allow_overwrite=True``, where leftover content from a previously larger
46 file could remain after overwriting with a smaller one due to lack of
47 truncation (:ticket:`36298`).
48
49 * Fixed a regression in Django 5.2 that caused a crash when using
50 ``QuerySet.select_for_update(of=(…))`` with ``values()/values_list()``
51 including expressions (:ticket:`36301`).
52
53 * Fixed a regression in Django 5.2 that caused improper values to be returned
54 from ``QuerySet.values_list()`` when duplicate field names were specified
55 (:ticket:`36288`).
56
57 * Fixed a regression in Django 5.2 where the password validation error message
58 from ``MinimumLengthValidator`` was not translated when using non-English
59 locales (:ticket:`36314`).
60
61 * Fixed a regression in Django 5.2 that caused the ``object-tools`` block to be
62 rendered twice when using custom admin templates with overridden blocks due
63 to changes in the base admin page block structure (:ticket:`36331`).
64
65 * Fixed a regression in Django 5.2, introduced when fixing :cve:`2025-26699`,
66 where the :tfilter:`wordwrap` template filter did not preserve empty lines
67 between paragraphs after wrapping text (:ticket:`36341`).
68
69 * Fixed a regression in Django 5.2 that caused a crash when serializing email
70 alternatives or attachments due to named tuple mismatches (:ticket:`36309`).
71
72 * Fixed a regression in Django 5.2 that caused a crash when using ``update()``
73 on a ``QuerySet`` filtered against a related model and including references
74 to annotations through ``values()`` (:ticket:`36360`).
75
76 * Fixed a bug in Django 5.2 that caused composite primary key introspection to
77 wrongly identify ``IntegerField`` as ``AutoField`` on SQLite
78 (:ticket:`36358`).
79
80 * Fixed a bug in Django 5.2 that caused a redundant ``unique_together``
81 constraint to be generated for composite primary keys when using
82 :djadmin:`inspectdb` (:ticket:`36357`).