1
0
mirror of https://github.com/django/django.git synced 2025-06-12 15:09:12 +00:00

33522 Commits

Author SHA1 Message Date
sag​e
fb427e467c
Fixed aggregation tests crash on databases that don't support JSONFields. 2025-04-27 09:03:35 +02:00
dbogar89
7b394b9988
Fixed #36335 -- Fixed typo in docs/topics/db/managers.txt. 2025-04-27 08:40:14 +02:00
Mariusz Felisiak
045110ff30 Refs #36326 -- Fixed QuerySet.raw() crash on models with CompositePrimaryKey on Oracle.
Virtual CompositePrimaryKey fields should be ignored.

Regression in 1831f7733d3ef03d1ca7fac3e8d9f4c5e3e3375e.
2025-04-26 12:12:08 +01:00
nessita
0596263c31
Fixed #36309 -- Made email alternatives and attachments pickleable.
Regression in aba0e541caaa086f183197eaaca0ac20a730bbe4 and in
d5bebc1c26d4c0ec9eaa057aefc5b38649c0ba3b.

Thanks Florent Messa for the report, and Jake Howard and Claude
Paroz for the review.
2025-04-24 10:11:16 -03:00
nessita
c86242d61f
Refs #36341 -- Added release notes for 5.1.9 and 4.2.21 for fix in wordwrap template filter.
Revision 1e9db35836d42a3c72f3d1015c2f302eb6fee046 fixed a regression in
55d89e25f4115c5674cdd9b9bcba2bb2bb6d820b, which also needs to be
backported to the stable branches in extended support (5.1.x and 4.2.x).
2025-04-23 17:26:48 -03:00
Matti Pohjanvirta
1e9db35836 Fixed #36341 -- Preserved whitespaces in wordwrap template filter.
Regression in 55d89e25f4115c5674cdd9b9bcba2bb2bb6d820b.

This work improves the django.utils.text.wrap() function to ensure that
empty lines and lines with whitespace only are kept instead of being
dropped.

Thanks Matti Pohjanvirta for the report and fix.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-04-23 16:14:03 -03:00
Sarah Boyce
18fa74fc88 Skipped "Labels" Github action when not targeting the main django/django repo. 2025-04-23 11:40:17 -03:00
Simon Charette
760121dcb1 Fixed #35801 -- Prevented collision of senders with non-overlapping lifetimes.
As documented, the id() function can return the same value for distinct
objects with non-overlapping lifetimes which can result in signals being
sent to the wrong receivers if two distinct senders happen to have a
colliding id() value.

Since reproduction of the issue requires memory constrained
circumstances where the same exact id() is reused for two senders of the
same signal the test opt to simulate the collision by systematically
making the same id for Sender instances.

Note that we explicitly avoid keeping a strong reference to senders that
cannot be weakly referenced as that would unexpectedly prevent them from
being garbage collected. This means that id(sender) collisions could
still occur for such objects but Django itself doesn't make use of them.

Thanks Sjoerd Job Postmus for the reduced test case and Mariusz for the
review.

Co-authored-by: And Clover <and@doxdesk.com>
2025-04-23 13:09:46 +01:00
Bona Fide IT GmbH
19067fe85a
Simplified UserManager.with_perm() by using get_backends(). 2025-04-23 13:01:19 +01:00
antoliny0919
1bc805e23b Fixed #36331 -- Reverted "Fixed #36055 -- Prevented overlap of object-tools buttons and page header in the admin."
This reverts commits b1324a680add78de24c763911d0eefa19b9263bc and
02a5cbfe76382da2a0414df17017185be5bd47f9. The former caused a regression
in admin sites that relied on the `object-tools` block being inside the
`content` block.

Thank you to Fabian Braun for the report.
2025-04-22 22:13:38 -03:00
SaJH
1831f7733d Fixed #36326 -- Added CompositePrimaryKey support in QuerySet.raw().
Signed-off-by: SaJH <wogur981208@gmail.com>
2025-04-17 17:23:06 +02:00
Sarah Boyce
d755a98b84 Fixed #35959 -- Displayed password reset button in admin only when user has sufficient permissions.
This change ensures that the "Reset password" button in the admin is
shown only when the user has the necessary permission to perform a
password change operation. It reuses the password hashing rendering
logic in `display_for_field` to show the appropriate read-only widget
for users with view-only access.
2025-04-17 12:00:20 -03:00
Sarah Boyce
8a0ad1ebe3 Refs #35959 -- Added render_password_as_hash auth template tag for password rendering. 2025-04-17 12:00:20 -03:00
Ahmed Nassar
d469db978e Fixed #36314 -- Fixed MinimumLengthValidator error message translation.
Regression in ec7d69035a408b357f1803ca05a7c991cc358cfa.

Thank you Gabriel Trouvé for the report and Claude Paroz for the review.
2025-04-17 12:30:20 +02:00
farhan
4a293eff6f Fixed #28050 -- Added template name to TemplateSyntaxError. 2025-04-17 08:56:53 +02:00
Sarah Boyce
098c8bc99c
Disabled Chrome browser pop-ups that were interfering with selenium tests. 2025-04-16 15:00:48 -03:00
Adam Johnson
6ef0f5bc27 Americanized some spellings. 2025-04-16 10:21:38 +02:00
Mikuláš Poul
494d2dc316 Fixed #36274 -- Added support for run_before and atomic in MigrationWriter. 2025-04-16 10:20:49 +02:00
Natalia
5020a9d43a Replaced '' with * for consistent emphasis styling in docs/howto/custom-template-tags.txt. 2025-04-15 14:48:55 -03:00
Ahmed Nassar
be402891cd Fixed #36311 -- Unified spelling of "hardcode" and its variants in docs.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-04-15 14:48:55 -03:00
Ahmed Nassar
abbcef5280 Refs #36311 -- Unified spelling of "flatpage" in docs/ref/contrib/flatpages.txt. 2025-04-15 14:48:55 -03:00
Ahmed Nassar
8bca33f68a Fixed #36269 -- Documented how to test callable storage in FileField. 2025-04-15 10:05:59 +02:00
Ahmed Nassar
2c2f090555 Fixed #35993 -- Documented gettext f-string support limitations.
Thank you to Claude Paroz and Athena Wolfskämpf for the review.
2025-04-15 10:02:25 +02:00
Sarah Boyce
ab1b9cc1b3
Bumped versions in pre-commit and npm configurations. 2025-04-12 19:42:00 +02:00
Baptiste Mispelon
ac16d2876d
Fixed #36320 -- Ignored "duplicated_toc_entry" for ePub docs build. 2025-04-12 19:39:07 +02:00
Simon Charette
21f8be76d4 Fixed #36288 -- Addressed improper handling of duplicates in values_list().
Now that selected aliases are stored in sql.Query.selected: dict[str, Any]
the values_list() method must ensures that duplicate field name references are
assigned unique aliases.

Refs #28900.

Regression in 65ad4ade74dc9208b9d686a451cd6045df0c9c3a.

Thanks Claude for the report.
2025-04-11 09:04:49 +02:00
Andrew
2d1ac1dce8
Refs #36036 -- Removed unsupported 4D GEOS tests. 2025-04-09 22:40:55 -03:00
Sarah Boyce
1429e722f2 Sorted imports in django/templatetags/tz.py per isort. 2025-04-09 11:10:08 +02:00
Ahmed Nassar
522dd021b2 Fixed #35986 -- Fixed test classes with @translation.override decorator.
Co-authored-by: Simon Charette <charette.s@gmail.com>
2025-04-09 09:49:14 +02:00
Mike Edmunds
a627829e7b Refs #35581 -- Updated mail tests to include trailing newlines.
Python's modern email API will force a trailing newline onto all text/*
bodies and attachments. Updated mail tests to include (and check for)
the newline while still using the legacy email API.

See https://github.com/python/cpython/issues/121515 which reasons that,
apart from artificial test cases, most text content already ends in a
newline. If it doesn't, adding one won't change the meaning.
2025-04-09 09:46:10 +02:00
Clifford Gama
a2f7b3a6a0 Clarified url and name arguments in flatpages URLconf ref docs. 2025-04-08 22:02:10 -03:00
Natalia
f9f0a18327 Added missing closing parenthesis in docs/ref/contrib/flatpages.txt. 2025-04-08 22:02:10 -03:00
Simon Charette
71a19a0e47 Fixed #36301 -- Fixed select_for_update(of) crash when using values()/values_list().
Regression in 65ad4ade74dc9208b9d686a451cd6045df0c9c3a which allowed for
annotations to be SELECT'ed before model field references through
values()/values_list() and broke assumptions the select_for_update(of)
table infererence logic had about model fields always being first.

Refs #28900.

Thanks OutOfFocus4 for the report and Sarah for the test.
2025-04-07 22:56:40 +02:00
Sarah Boyce
8ad3e80e88 Fixed #36298 -- Truncated the overwritten file content in file_move_safe().
Regression in 58cd4902a71a3695dd6c21dc957f59c333db364c.

Thanks Baptiste Mispelon for the report.
2025-04-07 16:11:36 +02:00
Mariusz Felisiak
d4a2809c2b
Added supports_expression_defaults check in DefaultTests.test_full_clean() test. 2025-04-06 09:40:12 +02:00
Simon Charette
12b771a1ec Fixed #36299 -- Prevented field selection on QuerySet.alias() after values().
Regression in 65ad4ade74dc9208b9d686a451cd6045df0c9c3a.

Refs #28900.

Thanks Jeff Iadarola for the report and tests.

Co-Authored-By: OutOfFocus4 <jeff.iadarola@gmail.com>
2025-04-05 20:43:50 +02:00
Kelvin Adigwu
25f97e7bcf
Fixed #36156 -- Added supports_json_field check in test_db_default_output_field_resolving test. 2025-04-05 18:54:08 +02:00
Tim Graham
02e7a162a0
Refs #36088, Refs #36260 - Added supports_expression_defaults checks in bulk_create() tests. 2025-04-05 18:47:53 +02:00
Simon Charette
764af7a3d6 Fixed #36289 -- Fixed bulk_create() crash with nullable geometry fields on PostGIS.
Swapped to an allow list instead of a deny list for field types to
determine if the UNNEST optimization can be enabled to avoid further
surprises with other types that would require further specialization to
adapt.

Regression in a16eedcf9c69d8a11d94cac1811018c5b996d491.

Thanks Joshua Goodwin for the report and Sarah Boyce for the test.
2025-04-04 21:33:04 +02:00
Natalia
4a824b1313 Added usage for --since when fetching translations in docs/internals/howto-release-django.txt. 2025-04-04 15:55:07 -03:00
Natalia
e715b07cf3 Improved "fetch" translations helper to restrict the resulting set by date. 2025-04-04 15:55:07 -03:00
koffi
019acad112 Fixed #36255 -- Renamed the admin action button for improved accessibility. 2025-04-04 17:41:13 +02:00
Simon Charette
f7f38f3a0b Fixed #36290 -- Made TupleIn() lookup discard tuples containing None.
Just like the In() lookup discards of None members TupleIn() should
discard tuples containing any None as NULL != NULL in SQL and the
framework expects such queries to be elided under some circumstances.

Refs #31667, #36116.

Thanks Basptise Mispelon for bisecting the regression to 626d77e.
2025-04-03 20:40:43 +02:00
Simon Charette
543e17c440 Fixed #36292 -- Fixed crash when aggregating over a group mixing transforms and references.
Regression in 65ad4ade74dc9208b9d686a451cd6045df0c9c3a.

Refs #28900

Thanks Patrick Altman for the report.
2025-04-03 17:51:26 +02:00
Nick Pope
3ae049b26b Fixed #35980 -- Updated setuptools to normalize package names in built artifacts. 2025-04-03 12:37:04 -03:00
Sarah Boyce
c7ff347c64 Added stub release notes for 5.2.1. 2025-04-02 15:24:48 +02:00
Sarah Boyce
345ba995c0 Finalized release notes for Django 5.2. 2025-04-02 14:43:00 +02:00
Sarah Boyce
b83dab7d8d Added CVE-2025-27556 to security archive. 2025-04-02 13:31:24 +02:00
Sarah Boyce
39e2297210 Fixed CVE-2025-27556 -- Mitigated potential DoS in url_has_allowed_host_and_scheme() on Windows.
Thank you sw0rd1ight for the report.
2025-04-02 10:21:33 +02:00
Ahmed Nassar
00c68f03b5 Fixed #36267 -- Fixed contenttypes shortcut() view crash with an invalid object_id for a UUIDField pk. 2025-04-02 09:33:13 +02:00