1
0
mirror of https://github.com/django/django.git synced 2025-09-17 22:49:35 +00:00

14081 Commits

Author SHA1 Message Date
Jacob Walls
b931156c20 Refs #35859 -- Removed support for Task enqueuing on transaction commit.
This removes the ability to configure Task enqueueing via a setting,
since the proposed `ENQUEUE_ON_COMMIT` did not support multi-database
setups.

Thanks to Simon Charette for the report.

Follow-up to 4289966d1b8e848e5e460b7c782dac009d746b20.
2025-09-17 13:28:58 -03:00
Simon Charette
4fcc2883fa Refs #27222 -- Restored Model.save()'s refreshing of db_returning fields even if a value is set.
The logic could likely be adjusted to assign the pre_save value in most cases
to avoid the database transit but it could break in subtle ways so it's not
worth the complexity it would require.

Regression in 94680437a45a71c70ca8bd2e68b72aa1e2eff337.

Co-authored-by: Tim Graham <timograham@gmail.com>
2025-09-17 07:50:08 -04:00
antoliny0919
1e7728888d Fixed #36601 -- Fixed color contrast of FilteredSelectMultiple widget chosen labels in TabularInlines.
Regression in a0f50c2a483678d31bd1ad6f08fd3a0b8399e27b.
2025-09-17 09:56:01 +02:00
Adam Zapletal
606fc35279 Fixed #36083 -- Ran system checks in ParallelTestSuite workers.
Workers created by ParallelTestSuite were not running system
checks in the spawn multiprocessing mode. In general this is
fine, but system checks can have side effects expected by tests.

This patch runs system checks inside of _init_worker, which is
only called by ParallelTestSuite.
2025-09-16 21:57:22 -04:00
Adam Johnson
2336d5d33a Refs #36606 -- Added tests for QuerySet.values_list(flat=True) without fields. 2025-09-16 20:58:40 -04:00
Jake Howard
4289966d1b Fixed #35859 -- Added background Tasks framework interface.
This work implements what was defined in DEP 14
(https://github.com/django/deps/blob/main/accepted/0014-background-workers.rst).

Thanks to Raphael Gaschignard, Eric Holscher, Ran Benita, Sarah Boyce,
Jacob Walls, and Natalia Bidart for the reviews.
2025-09-16 17:28:32 -03:00
GappleBee
218f69f05e Fixed #28041 -- Added Lexeme expression to contrib.postgres.search.
This expression automatically escapes its input and allows
fine-grained control over prefix matching and term weighting
via logical combinations.

Thanks Mariusz Felisiak, Adam Zapletal, Paolo Melchiorre,
Jacob Walls, Adam Johnson, and Simon Charette for reviews.

Co-authored-by: joetsoi <joetsoi@users.noreply.github.com>
Co-authored-by: Karl Hobley <karl@kaed.uk>
Co-authored-by: Alexandr Tatarinov <tatarinov1997@gmail.com>
2025-09-16 15:09:11 -04:00
blingblin-g
e08fa42fa6 Fixed #36426 -- Added support for further iterables in prefetch_related_objects().
Thanks Sarah Boyce for the review.
2025-09-16 14:14:23 -04:00
Jacob Walls
e059bbec96 Refs #27222 -- Deduplicated db_returning fields in Model.save().
Follow-up to 94680437a45a71c70ca8bd2e68b72aa1e2eff337.
2025-09-16 12:54:10 -04:00
SaJH
8c621e9642 Fixed #36580 -- Fixed constraint validation crash when condition uses a ForeignObject.
Follow-up to e44e8327d3d88d86895735c0e427102063ff5b55. Refs #36222.
2025-09-16 10:25:16 -04:00
SaJH
308f674e6d Refs #36580 -- Added coverage for excluding ForeignObject from constraint validation. 2025-09-16 10:25:16 -04:00
David Smith
82b3b84a78 Fixed OGRInspectTest.test_time_field with memory Spatialite database. 2025-09-16 08:10:31 +02:00
Natalia
424e0d8697 Fixed #36520 -- Reverted "Fixed #35440 -- Simplified parse_header_parameters by leveraging stdlid's Message."
This partially reverts commit 9aabe7eae3eeb3e64c5a0f3687118cd806158550.

The simplification of parse_header_parameters using stdlib's Message
is reverted due to a performance regression. The check for the header
maximum length remains in place, per Security Team guidance.

Thanks to David Smith for reporting the regression, and Jacob Walls for
the review.
2025-09-15 22:14:50 -03:00
Caitie Baca
0e0b4214c3 Fixed #36589 -- Made assertTemplateUsed/NotUsed track full path for PartialTemplate.
Previously, assertTemplateUsed only matched partial names, ignoring
the template origin. This caused assertions on partials specified by
origin ("template.html#partial") to fail. Refs #36410.
2025-09-15 16:45:13 -04:00
David Sanders
6e89271a85 Refs #27489 -- Made RenamePermission() operation respect database.
Regression in f02b49d2f3bf84f5225de920ca510149f1f9f1da.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2025-09-15 21:17:18 +02:00
Simon Charette
94680437a4 Fixed #27222 -- Refreshed model field values assigned expressions on save().
Removed the can_return_columns_from_insert skip gates on existing
field_defaults tests to confirm the expected number of queries are
performed and that returning field overrides are respected.
2025-09-14 00:27:50 +02:00
Simon Charette
55a0073b3b Refs #27222 -- Refreshed GeneratedFields values on save() initiated update.
This required implementing UPDATE RETURNING machinery that heavily
borrows from the INSERT one.
2025-09-14 00:27:49 +02:00
Adam Johnson
7b26b64a63
Refs #35667 -- Cached Django file prefixes for warnings. 2025-09-12 10:35:01 +02:00
Adam Johnson
41bc48ac1e
Fixed #36603 -- Optimized check order in LoginRequiredMiddleware. 2025-09-11 11:09:53 +02:00
Tim Graham
2a636118da Fixed #36564 -- Changed DEFAULT_AUTO_FIELD from AutoField to BigAutoField. 2025-09-05 10:43:10 -04:00
Ryan P Kilby
bad03eb108 Fixed #36481 -- Fixed QuerySet.update concrete fields check.
FieldError is now emitted for invalid update calls involving reverse
relations, where previously they failed with AttributeError.
2025-09-04 12:15:45 -04:00
Ryan P Kilby
11c2c9ac17 Refs #36481 -- Improved test coverage for invalid updates on reverse relations. 2025-09-04 12:15:45 -04:00
farhan
34bd3ed944 Refs #36559, #35667 -- Used skip_file_prefixes in PartialTemplate.source warning. 2025-09-04 12:14:10 -04:00
Ronan LE HAY
e197953f11 Refs #34989 -- Ensured the Content-Length header is set when redirect with APPEND_SLASH. 2025-09-03 22:49:34 +02:00
farhan
d82f25d3f0 Fixed #36559 -- Respected verbatim and comment blocks in PartialTemplate.source. 2025-09-03 10:59:58 -04:00
farhan
3485599ef0 Refs #36559 -- Ran template partial source tests in debug mode only.
Added a warning for accessing PartialTemplate.source when debugging is disabled.
Thanks Sarah Boyce for the idea.
2025-09-03 10:59:58 -04:00
Jake Howard
5171171709 Fixed CVE-2025-57833 -- Protected FilteredRelation against SQL injection in column aliases.
Thanks Eyal Gabay (EyalSec) for the report.
2025-09-03 13:10:58 +02:00
SaJH
bb7a7701b1 Fixed #36431 -- Returned tuples for multi-column ForeignObject in values()/values_list().
Thanks Jacob Walls and Simon Charette for tests.

Signed-off-by: SaJH <wogur981208@gmail.com>
2025-08-29 15:33:44 -04:00
Jacob Walls
2d453a2a68 Refs #36152 -- Suppressed duplicate warning when using "%" in alias via values(). 2025-08-29 13:45:08 -04:00
SaJH
0be1c4575b Fixed #34624 -- Removed change, delete, and view buttons for non-Select widgets in RelatedFieldWidgetWrapper.
Signed-off-by: SaJH <wogur981208@gmail.com>
2025-08-29 08:38:12 +02:00
Rob Hudson
550822bcee Fixed #36532 -- Added Content Security Policy view decorators to override or disable policies.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-08-28 17:23:48 -03:00
Jake Howard
41ff30f6f9 Refs #36520 -- Ensured only the header value is passed to parse_header_parameters for multipart requests.
Header parsing should apply only to the header value. The previous
implementation happened to work but relied on unintended behavior.
2025-08-28 14:25:36 -03:00
SaJH
a9fe98d5bd Fixed #35533 -- Prevented urlize creating broken links given a markdown link input.
Signed-off-by: SaJH <wogur981208@gmail.com>
2025-08-28 08:54:56 +02:00
Tim Graham
1285de557b Fixed incorrect IDs in test_in_bulk_preserve_ordering. 2025-08-27 18:23:42 -04:00
Sarah Boyce
d0e4dd5cdd Fixed #36572 -- Revert "Fixed #36546 -- Deprecated django.utils.crypto.constant_time_compare() in favor of hmac.compare_digest()."
This reverts commit 0246f478882c26bc1fe293224653074cd46a90d0.
2025-08-27 10:50:50 +02:00
Jacob Walls
d454aefbd1
Refs #15727 -- Captured failed request log in CSPMiddlewareTest. 2025-08-26 17:26:01 -04:00
antoliny0919
3e7aedfb2e Fixed #36556 -- Fixed TabularInline width overflowing the page. 2025-08-26 13:45:28 +02:00
SaJH
0246f47888 Fixed #36546 -- Deprecated django.utils.crypto.constant_time_compare() in favor of hmac.compare_digest().
Signed-off-by: SaJH <wogur981208@gmail.com>
2025-08-25 14:45:16 +02:00
SaJH
3ba24c18e7 Fixed #36251 -- Avoided mutating form Meta.fields in BaseInlineFormSet.
Signed-off-by: SaJH <wogur981208@gmail.com>
2025-08-25 10:05:45 +02:00
Mariusz Felisiak
b3166e1e15 Refs #35530 -- Corrected deprecation message in auth.alogin().
Follow up to ceecd518b19044181a3598c55ebed7c2545963cc.
2025-08-22 16:14:09 +02:00
Natalia
d6a8e5f5e1 Fixed failing bulk_create test raising IntegrityError when run in reverse.
When running the `bulk_create` tests with Postgres settings and
`--reverse`, the following IntegrityError was raised in
bulk_create.tests.BulkCreateTransactionTests.test_objs_with_and_without_pk:

django.db.utils.IntegrityError: duplicate key value violates unique
constraint "bulk_create_country_pkey"
DETAIL:  Key (id)=(1) already exists.

This branch fixes this by ensuring the ID is unique since DB sequences
are not resetted between tests.
2025-08-21 12:25:57 -03:00
antoliny0919
aae7836cc0 Refs #36366 -- Fixed page number layout in admin pagination on small screens.
Regression in 3f59711581bd22ebd0f13fb040b15b69c0eee21f.
2025-08-21 17:04:28 +02:00
SaJH
f2a6c0477f Fixed #36399 -- Added support for multiple Cookie headers in HTTP/2 for ASGIRequest.
Signed-off-by: SaJH <wogur981208@gmail.com>
2025-08-21 16:48:54 +02:00
mengxun
ed7c1a5640 Fixed #36560 -- Prevented UpdateCacheMiddleware from caching responses with Cache-Control 'no-cache' or 'no-store'. 2025-08-21 16:48:36 +02:00
Jacob Walls
d3cf24e9b4 Refs #36430, #36416, #34378 -- Simplified batch size calculation in QuerySet.in_bulk(). 2025-08-21 16:47:41 +02:00
Jacob Walls
a2ce4900a6 Fixed #36430 -- Removed artificially low limit on single field bulk operations on SQLite. 2025-08-21 16:47:41 +02:00
David Smith
fb0d463b1f Fixed #36382 -- Confirmed support for GDAL 3.11.
TIGER driver was removed in GDAL 3.11.

eb793be039
2025-08-21 16:46:41 +02:00
Xinyi Rong
cd7554e551 Fixed #36561 -- Used request.auser() in contrib.auth.aupdate_session_auth_hash(). 2025-08-20 09:14:50 +02:00
Artyom Kotovskiy
f02b49d2f3 Fixed #27489 -- Renamed permissions upon model renaming in migrations. 2025-08-19 16:36:52 +02:00
antoliny0919
4187da258f Fixed #35892 -- Supported Widget.use_fieldset in admin forms. 2025-08-19 16:35:56 +02:00