Jake Howard
c075508b4d
Fixed #36411 -- Made HttpRequest.get_preferred_type() consider media type parameters.
...
Docs / docs (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
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
myoungjinGo-BE
953095d1e6
Fixed #36060 -- Prevented IntegrityError in bulk_create() with order_with_respect_to.
2025-06-03 17:27:33 +03:00
Blayze
90429625a8
Fixed #36423 -- Prevented filter_horizontal buttons from intercepting form submission.
...
Docs / docs (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
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 857b1048d5 .
2025-06-02 22:25:14 -03:00
Clifford Gama
ad28db666e
Removed redundant redefinition of variable in tests/test_utils/tests.py.
Docs / docs (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Tests / JavaScript tests (push) Has been cancelled
Linters / flake8 (push) Has been cancelled
Linters / isort (push) Has been cancelled
Linters / black (push) Has been cancelled
Tests / Windows, SQLite, Python 3.13 (push) Has been cancelled
2025-05-27 18:20:07 -03:00
Nick Pope
b373721af0
Fixed flakiness in file_storage.tests.CustomStorageTests.test_file_get_accessed_time.
...
Two separate calls to look up access time can result in sub-second
differences which cause the test to fail.
Also made the equivalent tests for ctime and mtime have the same
changes to ensure that they won't flake in the same way in future.
2025-05-23 11:23:47 -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 a76035e925 .
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
Simon Charette
ec7f0bcf79
Refs #35444 -- Adjusted multi-args distinct aggregate test ordering expectations.
...
Unless an explicit order_by is specified for the test the ordering of the
aggregation results is undefined.
2025-05-23 11:19:31 +02:00
Sarah Boyce
1704c49a9b
Fixed #36390 -- Deprecated RemoteUserMiddleware subclasses missing aprocess_request().
...
Regression in 50f89ae850 .
Thank you to shamoon for the report and Natalia Bidart for the review.
2025-05-23 10:22:36 +02:00
Natalia
ad6f998898
Added helpers in csrf_tests and logging_tests to assert logs from log_response().
Linters / flake8 (push) Has been cancelled
Linters / isort (push) Has been cancelled
Linters / black (push) Has been cancelled
Tests / Windows, SQLite, Python 3.13 (push) Has been cancelled
Tests / JavaScript tests (push) Has been cancelled
2025-05-22 15:39:31 -03:00
Natalia
8970468159
Refs #26688 -- Added tests for log_response() internal helper.
2025-05-22 15:39:31 -03:00
ontowhee
ddb8529415
Fixed #34262 -- Added support for AnyValue for SQLite, MySQL, Oracle, and Postgresql 16+.
...
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
Docs / docs (push) Has been cancelled
Docs / blacken-docs (push) Has been cancelled
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
Colleen Dunlap
802baf5da5
Fixed #36388 -- Made QuerySet.union() return self when called with no arguments.
...
Docs / docs (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Linters / flake8 (push) Has been cancelled
Linters / isort (push) Has been cancelled
Linters / black (push) Has been cancelled
Tests / Windows, SQLite, Python 3.13 (push) Has been cancelled
Tests / JavaScript tests (push) Has been cancelled
Regression in 9cb8baa0c4 .
Thank you to Antoine Humeau for the report and Simon Charette for the review.
2025-05-19 10:34:14 +02:00
Samuel Cormier-Iijima
1ba5fe19ca
Fixed #36348 -- Fixed handling multiple nested url()s in ManifestStaticFilesStorage.
...
Linters / flake8 (push) Has been cancelled
Linters / isort (push) Has been cancelled
Linters / black (push) Has been cancelled
Tests / Windows, SQLite, Python 3.13 (push) Has been cancelled
Tests / JavaScript tests (push) Has been cancelled
Signed-off-by: Samuel Cormier-Iijima <samuel@cormier-iijima.com>
2025-05-16 15:56:17 +02:00
Jacob Walls
994dc6d8a1
Fixed #36392 -- Raised ValueError when subquery referencing composite pk selects too many columns.
Linters / black (push) Waiting to run
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
Docs / docs (push) Has been cancelled
Docs / blacken-docs (push) Has been cancelled
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
Mariusz Felisiak
0b2ed4f7c8
Refs #35844 -- Skipped selenium and geoip2 requirement in Windows for Python 3.14+.
...
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
Follow up to d6925f0d6b .
2025-05-15 19:52:51 +02:00
Tim Graham
883ce03e43
Refs #34488 -- Made test files path resolution independent of current working directory in ClearableFileInput selenium tests.
Docs / docs (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
2025-05-15 13:02:00 -03:00
nessita
d6925f0d6b
Refs #35844 -- Skipped argon2-cffi requirement in Windows for Python 3.14+.
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
2025-05-14 22:43:22 +02:00
Timothy McCurrach
24693a144f
Fixed #35852 -- Fixed intcomma locale-aware formatting of string number representations.
Docs / docs (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
2025-05-14 16:04:04 +02:00
antoliny0919
8bc3dd8727
Fixed #35507 -- Improved accessibility of search and filter elements in the admin changelist.
2025-05-14 16:03:01 +02:00
Tim Graham
8638d8bf74
Fixed #36273 -- Moved Index system checks from Model to Index.check().
2025-05-14 16:00:53 +02:00
savanto
8620a3b0c7
Fixed #36085 -- Added JSONField support for negative array indexing on SQLite.
2025-05-14 13:21:18 +02:00
Adam Johnson
6e36f7f784
Fixed #36383 -- Improved migration serialization for functools.partial objects.
Docs / docs (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
2025-05-13 21:42:19 -03:00
Adam Johnson
57fdc104d2
Refs #36383 -- Added extra tests for serializing functools.partial in tests/migrations/test_writer.py.
...
This includes a test helper to better assert over the expected output.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-05-13 21:42:19 -03: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
Aleksandr Safonov
96c79be4e4
Fixed #36332 -- Corrected HttpRequest.get_full_path() and HttpRequest.get_full_path_info() examples.
Docs / docs (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
2025-05-13 17:41:17 +02:00
Jake Howard
f920937c8a
Fixed #35518 -- Optimized RoutePattern by using string operations for converter-less routes.
2025-05-13 12:05:58 +01:00
Carlton Gibson
f66c79e93d
Refs #35591 -- Ensured isolated test environ for runserver warning.
2025-05-13 12:02:30 +02:00
Thibaut Decombe
825ddda26a
Fixed #33174 -- Fixed migrations crash for model inheriting from Generic[T].
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
2025-05-12 17:39:20 +01:00
Simon Charette
8be0c0d690
Fixed #36373 -- Fixed select_related() crash on foreign object for a composite pk.
...
Docs / docs (push) Waiting to run
Docs / blacken-docs (push) Waiting to run
Linters / flake8 (push) Waiting to run
Linters / isort (push) Waiting to run
Linters / black (push) Waiting to run
Tests / Windows, SQLite, Python 3.13 (push) Waiting to run
Tests / JavaScript tests (push) Waiting to run
Thanks Jacob Walls for the report and Sarah for the in-depth review.
2025-05-12 12:33:07 +01:00
Jacob Walls
69ab6e5896
Fixed #36207 -- Cleared cached ForeignObject relations via refresh_from_db().
2025-05-09 13:01:04 +01:00
Tim Graham
f5197be818
Removed hardcoded pks in admin selenium tests.
2025-05-09 13:17:58 +02:00
Ahmed Nassar
84e91262d6
Fixed #36295 , Refs #24305 -- Allowed overriding GenericForeignKey fields on abstract models.
2025-05-08 16:07:08 +01:00
Eric Blum
384cdf0f7a
Fixed #36363 -- Added field names to admin duplicated fields error hint.
2025-05-08 11:38:13 +01:00
Sage Abdullah
358fd21c47
Fixed #36143 -- Made max_query_params respect SQLITE_LIMIT_VARIABLE_NUMBER.
...
Co-authored-by: Xavier Frankline <xf.xavierfrank@gmail.com>
2025-05-08 11:37:11 +01:00
Sage Abdullah
38660a612c
Refs #36143 -- Tested bulk_batch_size limit for bulk_update and bulk_create.
2025-05-08 11:37:11 +01:00
Sarah Boyce
9f3419b519
Fixed CVE-2025-32873 -- Mitigated potential DoS in strip_tags().
...
Thanks to Elias Myllymäki for the report, and Shai Berger and Jake
Howard for the reviews.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-05-06 22:21:42 -03:00
Mariusz Felisiak
dd133054cb
Refs #36052 , #32234 -- Fixed inspectdb tests for CompositePrimaryKey on Oracle.
...
Tests regression in 4c75858135 .
2025-05-06 08:20:56 +02:00
신우진
1fb3f57e81
Fixed #36281 -- Used async-safe write in ASGIHandler.read_body().
...
Thanks Carlton Gibson for reviews.
2025-05-04 14:53:08 +02:00
Baptiste Mispelon
66f9eb0ff1
Fixed #36357 -- Skipped unique_together in inspectdb output for composite primary keys.
...
Thanks to Baptiste Mispelon for the report and quick fix, and to Simon
Charette and Jacob Walls for the reviews.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-04-30 11:55:25 -03:00
Simon Charette
07100db6f4
Fixed #36358 -- Corrected introspection of composite primary keys on SQLite.
...
Previously, any first field of a composite primary key with type
`INTEGER` was incorrectly introspected as an `AutoField` due to SQLite
treating `INTEGER PRIMARY KEY` as an alias for the `ROWID`.
This change ensures that integer fields in composite PKs are not
mistaken for auto-incrementing fields.
Thanks Jacob Walls and Sarah Boyce for the reviews.
2025-04-30 10:51:48 -03:00
Simon Charette
4c75858135
Refs #36052 , #32234 -- Removed create_test_table_with_composite_primary_key flag in favor of using CompositePrimaryKey.
...
Now that Django properly supports creating models with composite primary
keys, the tests should use a `CompositePrimaryKey` field instead of a
feature flag to inline backend specific SQL for creating a composite PK.
Specifcially, the inspectdb's test_composite_primary_key was adjusted to
use schema editor instead of per-backend raw SQL.
2025-04-30 10:51:48 -03:00
Simon Charette
8ef4e0bd42
Fixed #36360 -- Fixed QuerySet.update() crash when referring annotations through values().
...
The issue was only manifesting itself when also filtering againt a related
model as that forces the usage of a subquery because SQLUpdateCompiler doesn't
support the UPDATE FROM syntax yet.
Regression in 65ad4ade74 .
Refs #28900 .
Thanks Gav O'Connor for the detailed report.
2025-04-30 10:38:19 +01:00
Simon Charette
27ffccc96b
Used bulk_create where possible in update tests.
...
This shaves off 21 INSERT queries.
Thanks Clifford for the review.
2025-04-30 10:38:19 +01:00
Baptiste Mispelon
2722cb61cc
Used addCleanup() instead of try-finally blocks in inspectdb tests.
2025-04-29 13:45:05 -03:00
Bruno Alla
bc21bc4282
Fixed #18296 -- Created missing custom target directory for startproject and startapp.
2025-04-27 14:41:27 +01:00
sage
fb427e467c
Fixed aggregation tests crash on databases that don't support JSONFields.
2025-04-27 09:03:35 +02:00
nessita
0596263c31
Fixed #36309 -- Made email alternatives and attachments pickleable.
...
Regression in aba0e541ca and in
d5bebc1c26 .
Thanks Florent Messa for the report, and Jake Howard and Claude
Paroz for the review.
2025-04-24 10:11:16 -03:00