1
0
mirror of https://github.com/django/django.git synced 2025-06-20 19:09:13 +00:00

14288 Commits

Author SHA1 Message Date
Jacob Walls
8ede411a81 Fixed #36152 -- Deprecated use of "%" in column aliases.
Unintentional support existed only on SQLite and Oracle.
2025-06-20 08:25:22 +02:00
Jake Howard
bc1bfe12b6
Clarified that only latest dependency versions are valid for security reports. 2025-06-18 11:04:34 -03:00
Clifford Gama
74b31cd26b Fixed #32770 -- Added system check to ensure django.contrib.postgres is installed when using its features.
Added postgres.E005 to validate 'django.contrib.postgres' is in INSTALLED_APPS
when using:
* PostgreSQL-specific fields (ArrayField, HStoreField, range fields, SearchVectorField),
* PostgreSQL indexes (PostgresIndex and all subclasses), and
* ExclusionConstraint

The check provides immediate feedback during system checks rather than failing
later with obscure runtime and database errors.

Thanks to Simon Charette and Sarah Boyce for reviews.
2025-06-18 08:36:49 +02:00
nessita
0f60102444
Added guidance on AI-assisted security reports to docs/internals/security.txt.
Co-authored-by: Shai Berger <shai@platonix.com>
Co-authored-by: Mike Edmunds <medmunds@gmail.com>
2025-06-17 11:45:03 -03:00
Clifford Gama
104cbfd44b Fixed #36453 -- Made When.condition resolve with for_save=False.
Value(None, JSONField()) when used in When.condition incorrectly resolved with
for_save=True, resulting in the value being serialized as SQL NULL instead of
JSON null.

Regression in c1fa3fdd040718356e5a3b9a0fe699d73f47a940.

Thanks to Thomas McKay for the report, and to David Sanders and Simon Charettes
for the review.

Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2025-06-16 10:40:29 +02:00
Jake Howard
12c1557060 Fixed #36447 -- Selected preferred media type based on quality.
When matching which entry in the `Accept` header should be used for
a given media type, the specificity matters. However once those are
resolved, only the quality matters when selecting preference.

Regression in c075508b4de8edf9db553b409f8a8ed2f26ecead.

Thank you to Anders Kaseorg for the report.
2025-06-16 09:25:25 +02:00
Sarah Boyce
8e2249bc79 Corrected jsonfield fieldlookup references. 2025-06-13 09:50:56 +02:00
Claude Paroz
f2f6046c0f Fixed #25706 -- Refactored geometry widgets to remove inline JavaScript.
Refactored GIS-related JavaScript initialization to eliminate inline
scripts from templates. Added support for specifying a base layer using
the new `base_layer_name` attribute on `BaseGeometryWidget`, allowing
custom map tile providers via user-defined JavaScript.

As a result, the `gis/openlayers-osm.html` template was removed.

Thanks Sarah Boyce for reviews.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-06-12 17:35:14 -03:00
Sulove Bista
e80b33ae4d
Fixed #36463 -- Fixed grammar in docs/intro/contributing.txt. 2025-06-12 15:14:15 -03:00
ruvilonix
f5cb757a67 Fixed #36454 -- Fixed typo in docs/intro/tutorial08.txt. 2025-06-12 09:55:30 +02:00
Clifford Gama
95a5c9b794
Made minor grammar and punctuation fixes in docs/topics/migrations.txt. 2025-06-11 12:52:26 -03:00
junghwan16
091f66e51a Fixed #36425 -- Standardized integer fields descriptions. 2025-06-11 09:59:00 +02:00
Sarah Boyce
2714bc3f2c Added follow-up to CVE-2025-48432 to security archive. 2025-06-10 15:08:30 +02:00
Sarah Boyce
7fcc7b1a0c Added stub release notes for 5.2.4. 2025-06-10 12:29:28 +02:00
Jacob Walls
76e1ca77bc Refs #373 -- Doc'd that on_delete is ignored for ForeignObject. 2025-06-10 09:44:40 +02:00
Jacob Walls
5942754769 Fixed #36449 -- Fixed field types in example model using ForeignObject. 2025-06-10 09:44:40 +02:00
Natalia
cf5f36bf90 Fixed #36446 -- Restored "q" in internal MediaType.params property.
The "q" key was removed while addressing ticket #36411. Despite
`MediaType.params` is undocumented and considered internal, it was used
in third-party projects (Zulip reported breakage), so this work restored
the `q` key in `params`.

Thanks Anders Kaseorg for the report.

Regression in c075508b4de8edf9db553b409f8a8ed2f26ecead.
2025-06-09 17:37:40 -03:00
Clifford Gama
c1fa3fdd04 Fixed #36419 -- Ensured for_save was propagated when resolving expressions.
The for_save flag wasn't properly propagated when resolving expressions, which
prevented get_db_prep_save() from being called in some cases. This affected
fields like JSONField where None would be saved as JSON null instead of SQL NULL.

Regression in 00c690efbc0b10f67924687f24a7b30397bf47d9.

Thanks to David Sanders and Simon Charette for reviews.

Co-authored-by: Adam Johnson <me@adamj.eu>
2025-06-06 17:40:35 +02:00
Jake Howard
9579517552 Refs CVE-2025-48432 -- Prevented log injection in remaining response logging.
Migrated remaining response-related logging to use the `log_response()`
helper to avoid potential log injection, to ensure untrusted values like
request paths are safely escaped.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-06-06 09:05:32 -03:00
Sarah Boyce
b762a6ab3c Updated translations from Transifex.
Forwardport of 5901cfe591139b4389171ba738be81e8f4d5cfc9 from stable/5.2.x.
2025-06-06 13:57:27 +02:00
Natalia
51923c576a Added CVE-2025-48432 to security archive. 2025-06-04 10:57:51 -03:00
Natalia
1f19c36e2d Added stub release notes for 5.2.3. 2025-06-04 10:55:33 -03:00
Natalia
a07ebec559 Fixed CVE-2025-48432 -- Escaped formatting arguments in log_response().
Suitably crafted requests containing a CRLF sequence in the request
path may have allowed log injection, potentially corrupting log files,
obscuring other attacks, misleading log post-processing tools, or
forging log entries.

To mitigate this, all positional formatting arguments passed to the
logger are now escaped using "unicode_escape" encoding.

Thanks to Seokchan Yoon (https://ch4n3.kr/) for the report.

Co-authored-by: Carlton Gibson <carlton@noumenal.es>
Co-authored-by: Jake Howard <git@theorangeone.net>
2025-06-04 08:33:30 -03:00
Simon Charette
08187c94ed Fixed #36432 -- Fixed a prefetch_related crash on related target subclass queryset.
Regression in 626d77e52a3f247358514bcf51c761283968099c.

Refs #36116.

Thanks Cornelis Poppema for the excellent report.
2025-06-04 10:46:49 +02:00
Jake Howard
c075508b4d Fixed #36411 -- Made HttpRequest.get_preferred_type() consider media type parameters.
HttpRequest.get_preferred_type() did not account for parameters in
Accept header media types (e.g., "text/vcard; version=3.0"). This caused
incorrect content negotiation when multiple types differed only by
parameters, reducing specificity as per RFC 7231 section 5.3.2
(https://datatracker.ietf.org/doc/html/rfc7231.html#section-5.3.2).

This fix updates get_preferred_type() to treat media types with
parameters as distinct, allowing more precise and standards-compliant
matching.

Thanks to magicfelix for the report, and to David Sanders and Sarah
Boyce for the reviews.
2025-06-03 16:10:41 -03:00
Jacob Walls
26313bc219 Fixed #36416 -- Made QuerySet.in_bulk() account for composite pks in id_list. 2025-06-03 18:45:15 +03:00
Blayze
90429625a8 Fixed #36423 -- Prevented filter_horizontal buttons from intercepting form submission.
In the admin's filter_horizontal widget, optional action buttons like
"Choose all", "Remove all", etc. were changed from `<a>` to `<button>`
elements in #34619, but without specifying `type="button"`. As a result,
when pressing Enter while focused on a form input, these buttons could
be triggered and intercept form submission.

Explicitly set `type="button"` on these control buttons to prevent them
from acting as submit buttons.

Thanks Antoliny Lee for the quick triage and review.

Regression in 857b1048d53ebf5fc5581c110e85c212b81ca83a.
2025-06-02 22:25:14 -03:00
Natalia
1a74434399 Added stub release notes and release date for 5.2.2, 5.1.10, and 4.2.22. 2025-05-28 10:03:06 -03:00
Jason Judkins
1307b8a1cb
Fixed #36402, Refs #35980 -- Updated built package name in reusable apps tutorial for PEP 625. 2025-05-26 12:33:29 -03:00
Adam Johnson
c2615a0500 Fixed #36405 -- Fixed Aggregate.order_by using OuterRef.
co-authored-by: Simon Charette <charette.s@gmail.com>
2025-05-23 16:15:59 +02:00
Adam Johnson
b8e5a8a9a2 Fixed #36404 -- Fixed Aggregate.filter using OuterRef.
Regression in a76035e925ff4e6d8676c65cb135c74b993b1039.
Thank you to Simon Charette for the review.

co-authored-by: Simon Charette <charette.s@gmail.com>
2025-05-23 15:17:20 +02:00
Adam Zapletal
d2732c30af Fixed typo in docs/ref/forms/renderers.txt. 2025-05-23 11:19:59 +02:00
Sarah Boyce
1704c49a9b Fixed #36390 -- Deprecated RemoteUserMiddleware subclasses missing aprocess_request().
Regression in 50f89ae850f6b4e35819fe725a08c7e579bfd099.
Thank you to shamoon for the report and Natalia Bidart for the review.
2025-05-23 10:22:36 +02:00
ontowhee
ddb8529415 Fixed #34262 -- Added support for AnyValue for SQLite, MySQL, Oracle, and Postgresql 16+.
Thanks Simon Charette for the guidance and review. Thanks Tim Schilling for the
documentation review. Thanks David Wobrock for investigation and solution proposals.
2025-05-20 10:01:42 +02:00
Jacob Walls
f603ece016
Fixed typo in docs/releases/6.0.txt. 2025-05-19 15:09:09 -03:00
Colleen Dunlap
802baf5da5 Fixed #36388 -- Made QuerySet.union() return self when called with no arguments.
Regression in 9cb8baa0c4fa2c10789c5c8b65f4465932d4d172.
Thank you to Antoine Humeau for the report and Simon Charette for the review.
2025-05-19 10:34:14 +02:00
Jacob Walls
994dc6d8a1 Fixed #36392 -- Raised ValueError when subquery referencing composite pk selects too many columns. 2025-05-16 08:19:38 +02:00
Simon Charette
e03e5c751c Fixed #33312 -- Raised explicit exception when copying deferred model instances.
Previously save() would crash with an attempted forced update message, and both
save(force_insert=True) and bulk_create() would crash with DoesNotExist errors
trying to retrieve rows with an empty primary key (id IS NULL).

Implementing deferred field model instance copying might be doable in certain
cases (e.g. when all the deferred fields are db generated) but that's not
trivial to implement in a backward compatible way.

Thanks Adam Sołtysik for the report and test and Clifford for the review.
2025-05-16 08:13:57 +02:00
antoliny0919
a79c411147 Added missing import in docs/ref/contrib/admin/index.txt. 2025-05-15 15:48:00 +02:00
Jacob Walls
e52100a250
Fixed incorrect spacing in docs/ref/contrib/postgres/fields.txt. 2025-05-15 09:22:10 -03:00
Pablo Bengoechea
87ab54b488 Fixed #35829 -- Updated admin icons using Font Awesome Free version 6.7.2.
Co-authored-by: Stefan <96178532+stefan6419846@users.noreply.github.com>
2025-05-15 09:09:27 -03:00
savanto
8620a3b0c7 Fixed #36085 -- Added JSONField support for negative array indexing on SQLite. 2025-05-14 13:21:18 +02:00
Adam Johnson
4647e2b866 Refs #36383 -- Extended DeconstructibleSerializer to support non-identifier keyword arguments.
In Python, keyword arguments must normally be valid identifiers (i.e.,
variable names that follow Python's naming rules). However, Python dicts
can have keys that aren't valid identifiers, like "foo-bar" or "123foo".

This commit ensures that keyword arguments that are nt valid
identifiers, are properly handled when deconstructing an object.
2025-05-13 21:42:19 -03:00
Lily Foote
188799e67c Updated guidance to propose new feature ideas in contributing docs.
These changes include:
* Clarification of the new feature proposal and evaluation process.
* Reodering "points to consider" into reporting bugs section, since
  these are mostly trac-specific.
* Narrowing the guide on user interface bugs and features to just bugs.
* Updating documentation for Someday/Maybe triage stage.

Co-authored-by: Tim Schilling <schilling711@gmail.com>
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-05-13 21:38:04 -03:00
Aleksandr Safonov
96c79be4e4 Fixed #36332 -- Corrected HttpRequest.get_full_path() and HttpRequest.get_full_path_info() examples. 2025-05-13 17:41:17 +02:00
Simon Charette
8be0c0d690 Fixed #36373 -- Fixed select_related() crash on foreign object for a composite pk.
Thanks Jacob Walls for the report and Sarah for the in-depth review.
2025-05-12 12:33:07 +01:00
Natalia
42ab99309d Refs #35980 -- Added release note about changes in release artifacts filenames. 2025-05-09 13:29:19 -03:00
Natalia
c86156378d Removed "Expected" from release date for 5.2.1, 5.1.9, and 4.2.21. 2025-05-09 13:29:19 -03:00
Natalia
37f2a77c72 Cleaned up CVE-2025-32873 security archive description. 2025-05-07 11:36:05 -03:00
Natalia
fdabda4e05 Added CVE-2025-32873 to security archive. 2025-05-07 10:59:55 -03:00