Sarah Boyce
8e7a44e4be
[5.0.x] Fixed CVE-2024-39614 -- Mitigated potential DoS in get_supported_language_variant().
...
Language codes are now parsed with a maximum length limit of 500 chars.
Thanks to MProgrammer for the report.
2024-07-09 10:03:38 -03:00
Natalia
9f4f63e9eb
[5.0.x] Fixed CVE-2024-39330 -- Added extra file name validation in Storage's save method.
...
Thanks to Josh Schneier for the report, and to Carlton Gibson and Sarah
Boyce for the reviews.
2024-07-09 10:03:32 -03:00
Michael Manfre
07cefdee4a
[5.0.x] Fixed CVE-2024-39329 -- Standarized timing of verify_password() when checking unusuable passwords.
...
Refs #20760 .
Thanks Michael Manfre for the fix and to Adam Johnson for the review.
2024-07-09 10:03:20 -03:00
Adam Johnson
7285644640
[5.0.x] Fixed CVE-2024-38875 -- Mitigated potential DoS in urlize and urlizetrunc template filters.
...
Thank you to Elias Myllymäki for the report.
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com >
2024-07-09 10:03:07 -03:00
Mariusz Felisiak
c76089be6f
[5.0.x] Refs #35560 -- Corrected CheckConstraint argument name in model_fields tests.
2024-07-08 12:38:04 +02:00
Mark Gensler
0602fc2124
[5.0.x] Fixed #35560 -- Made Model.full_clean() ignore GeneratedFields for constraints.
...
Accessing generated field values on unsaved models caused a crash when
validating CheckConstraints and UniqueConstraints with expressions.
Backport of 1005c2abd1 from main.
2024-07-04 11:49:27 +02:00
Carlton Gibson
dd3d0483ab
[5.0.x] Refs #35059 -- Used asyncio.Event in ASGITest.test_asyncio_cancel_error to enforce specific interleaving.
...
Sleep call leads to a hard to trace error in CI. Using an Event is
more deterministic, and should be less prone to environment
variations.
Bug in 11393ab131 .
Backport of f4a08b6ddf from main.
2024-06-25 11:06:27 -03:00
sobolevn
9b5029f048
[5.0.x] Fixed #35426 -- Updated querysets to be a required argument of GenericPrefetch.
...
Backport of 9a27c76021 from main.
2024-05-04 11:34:12 +02:00
Sarah Boyce
ac9e18f1c4
[5.0.x] Refs #35359 -- Fixed OperationTests.test_add_generate_field() test on PostgreSQL.
...
Concat() in Django 5.0 is not immutable on PostgreSQL and cannot be used
in GeneratedField, see 6364b6ee10 .
2024-05-03 23:52:24 -03:00
Mariusz Felisiak
c544f1a223
[5.0.x] Fixed #35422 -- Fixed migrations crash when altering GeneratedField referencing rename field.
...
Thanks Sarah Boyce for the report and Simon Charette for the
implementation idea.
Backport of 91a4b9a8ec from main.
2024-05-03 09:32:31 +02:00
DevilsAutumn
24f54c3b09
[5.0.x] Fixed #35359 -- Fixed migration operations ordering when adding fields referenced by GeneratedField.expression.
...
Thank you to Simon Charette for the review.
Backport of 9aeb38c296 from main.
2024-05-02 21:54:52 -03:00
fa202d5cb1
[5.0.x] Refs #34007 , Refs #35359 -- Added Q.referenced_based_fields property.
...
Thank you to Mariusz Felisiak and Natalia Bidart for the reviews.
Backport of 97d48cd3c6 from main
2024-05-02 21:45:02 -03:00
Simon Charette
9d79714e25
[5.0.x] Fixed #35373 -- Fixed a crash when indexing a generated field on SQLite.
...
Generated fields have to be excluded from the INSERT query against the remade
table including the index.
Thanks Moshe Dicker for the report, David Sanders and Mariusz Felisiak for the
review.
Backport of d048f0d311 from main.
2024-04-16 17:31:22 +02:00
Simon Charette
5d95a1c35e
[5.0.x] Refs #35194 -- Adjusted a generated field test to work on Postgres 15.6+.
...
Postgres >= 12.18, 13.14, 14.11, 15.6, 16.2 changed the way the immutability
of generated and default expressions is detected in postgres/postgres@743ddaf .
The adjusted test semantic is presereved by switching from __icontains to
__contains as both make use of a `%` literal which requires proper escaping.
Refs #35336 .
Thanks bcail for the report.
Backport of 73b62a2126 from main.
2024-04-12 14:59:01 +02:00
Sarah Boyce
f075a19e85
[5.0.x] Fixed #35350 -- Fixed save() with pk set on models with GeneratedFields.
...
Thanks Matt Hegarty for the report and Simon Charette and Natalia Bidart for the reviews.
Regression in f333e35 .
Backport of 8b53560eea from main.
2024-04-10 15:55:30 +02:00
Mariusz Felisiak
d859c0be9c
[5.0.x] Refs #35336 -- Fixed SchemaTests.test_add_generated_field_contains() test on PostgreSQL.
...
Concat() in Django 5.0 is not immutable on PostgreSQL and cannot be used
in GeneratedField, see 6364b6ee10 .
2024-04-05 09:14:35 -03:00
Simon Charette
fead2dd523
[5.0.x] Fixed #35336 -- Addressed crash when adding a GeneratedField with % literals.
...
A longer term solution is likely to have a better separation of parametrized
DDL altogether to handle checks, constraints, defaults, and generated fields
but such a change would require a significant refactor that isn't suitable
for a backport.
Thanks Adrian Garcia for the report.
Backport of 888b9042b3 from main
2024-04-02 17:34:38 -03:00
Johannes Westphal
14ab15d69a
[5.0.x] Fixed #35344 , Refs #34838 -- Corrected output_field of resolved columns for GeneratedFields in aliased tables.
...
Thanks Simon Charette for the review.
Backport of 5f18021640 from main
2024-04-01 22:14:52 -03:00
Mariusz Felisiak
345e3cf57f
[5.0.x] Fixed #35329 -- Fixed migrations crash when adding partial unique constraints with nulls_distinct.
...
Bug in 595a2abb58 .
Thanks Lucas Lemke Saunitti for the report.
Backport of b98271a6e4 from main
2024-03-26 22:59:23 +01:00
Johannes Maron
8fd953f28a
[5.0.x] Fixed #35273 -- Fixed rendering AdminFileWidget's attributes.
...
Regression in 8a6c0203c4 .
Backport of e69019555d from main
2024-03-14 20:37:53 +01:00
Ben Cail
5f07460a67
[5.0.x] Fixed #35223 -- Made Model.full_clean() ignore fields with db_default when validating empty values.
...
Thanks Brian Ibbotson for the report.
Regression in 7414704e88 .
Backport of 1570ef02f3 from main.
2024-03-08 06:46:40 +01:00
Shai Berger
3394fc6132
[5.0.x] Fixed CVE-2024-27351 -- Prevented potential ReDoS in Truncator.words().
...
Thanks Seokchan Yoon for the report.
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com >
2024-03-04 08:22:40 +01:00
Shafiya Adzhani
80761c3b01
[5.0.x] Fixed #35198 -- Fixed facet filters crash on querysets with no primary key.
...
Thanks Simon Alef for the report.
Regression in 868e2fcdda .
Backport of a738281265 from main
2024-02-29 10:37:26 +01:00
AlexCLeduc
69e5b13c75
[5.0.x] Fixed #35238 -- Fixed database serialization crash when base managers use prefetch_related().
...
Regression in 1391356276
following deprecation in eedbf930287cb72e9afab1f7208c24b1146b0c4ec.
Backport of a084c5d35a from main
2024-02-21 05:17:36 +01:00
Hisham Mahmood
3a54e64ef7
[5.0.x] Fixed #35173 -- Fixed ModelAdmin.lookup_allowed() for lookups on foreign keys when not included in ModelAdmin.list_filter.
...
Regression in f80669d2f5 .
Thanks Sarah Boyce for the review.
Backport of 8db593de05 from main
2024-02-15 08:18:27 -03:00
Daniel Garcia Moreno
1ba5afa0f2
[5.0.x] Refs #34900 , Refs #34118 -- Updated assertion in test_skip_class_unless_db_feature() test on Python 3.12.2+.
...
Python 3.12.2 bring back the skipped tests in the number of running
tests. Refs
0a737639dc
Backport of bc8471f0aa from main
2024-02-10 17:08:07 +01:00
Vašek Dohnal
761e913191
[5.0.x] Fixed #35174 -- Fixed Signal.asend()/asend_robust() crash when all receivers are asynchronous.
...
Regression in e83a88566a .
Backport of 1b5338d03e from main
2024-02-08 12:56:41 +01:00
Mariusz Felisiak
c22075af80
[5.0.x] Fixed #35172 -- Fixed intcomma for string floats.
...
Thanks Warwick Brown for the report.
Regression in 55519d6cf8 .
Backport of 2f14c2cedc from main
2024-02-08 10:59:43 +01:00
Adam Johnson
16a8fe18a3
[5.0.x] Fixed CVE-2024-24680 -- Mitigated potential DoS in intcomma template filter.
...
Thanks Seokchan Yoon for the report.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com >
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com >
Co-authored-by: Shai Berger <shai@platonix.com >
2024-02-06 09:13:21 -03:00
Simon Charette
761946f8e1
[5.0.x] Fixed #35149 -- Fixed crashes of db_default with unresolvable output field.
...
Field.db_default accepts either literal Python values or compilables
(as_sql) and wrap the former ones in Value internally.
While 1e38f11 added support for automatic resolving of output fields for
types such as str, int, float, and other unambigous ones it's cannot do
so for all types such as dict or even contrib.postgres and contrib.gis
primitives.
When a literal, non-compilable, value is provided it likely make the
most sense to bind its output field to the field its attached to avoid
forcing the user to provide an explicit `Value(output_field)`.
Thanks David Sanders for the report.
Backport of e67d7d70fa from main
2024-02-04 14:48:44 +01:00
Simon Charette
914eee1a9b
[5.0.x] Refs #35149 -- Made equivalent db_default alterations noops.
...
This allows for an easier transition of preserving the literal nature of
non-compilable db_default.
Backport of fe1cb62f5c from main
2024-02-04 14:48:32 +01:00
Simon Charette
3e7a30fb3a
[5.0.x] Fixed #35162 -- Fixed crash when adding fields with db_default on MySQL.
...
MySQL doesn't allow literal DEFAULT values to be used for BLOB, TEXT,
GEOMETRY or JSON columns and requires expression to be used instead.
Regression in 7414704e88 .
Backport of dfc77637ea from main
2024-02-04 09:24:38 +01:00
David Sanders
06b05c748f
[5.0.x] Refs #34936 -- Added test for altering DecimalField with db_default to non-nullable.
...
Backport of 1944f490f9 from main
2024-02-01 08:13:26 +01:00
James Thorniley
f1fbd061ac
[5.0.x] Fixed #35059 -- Ensured that ASGIHandler always sends the request_finished signal.
...
Prior to this work, when async tasks that process the request are cancelled due
to receiving an early "http.disconnect" ASGI message, the request_finished
signal was not being sent, potentially leading to resource leaks (such as
database connections).
This branch ensures that the request_finished signal is sent even in the case
of early termination of the response.
Regression in 64cea1e48f .
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com >
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es >
Backport of 11393ab131 from main
2024-01-31 14:45:44 -03:00
Natalia
bbb9ef3c62
[5.0.x] Refs #35059 -- Made asgi tests' SignalHandler helper class re-usable by other tests.
...
Backport of a43d75e81d from main
2024-01-31 14:45:13 -03:00
Mariusz Felisiak
7453d6a807
[5.0.x] Fixed #35159 -- Fixed dumpdata crash when base querysets use prefetch_related().
...
Regression in 1391356276
following deprecation in edbf930287 .
Thanks Andrea F for the report.
Backport of 38eaf2f21a from main
2024-01-31 16:10:50 +01:00
Nicolas Delaby
a5440054d2
[5.0.x] Fixed #35135 -- Made FilteredRelation raise ValueError on querysets as rhs.
...
Regression in 59f4754704 .
Backport of 820c5f1bac from main
2024-01-30 05:54:39 +01:00
Mariusz Felisiak
0379e7532f
[5.0.x] Applied Black's 2024 stable style.
...
https://github.com/psf/black/releases/tag/24.1.0
Backport of 305757aec1 from main
2024-01-26 12:55:56 +01:00
Mariusz Felisiak
ee78fe390d
[5.0.x] Fixed #35127 -- Made Model.full_clean() ignore GeneratedFields.
...
Thanks Claude Paroz for the report.
Regression in f333e3513e .
Backport of 4879907223 from main
2024-01-19 08:56:14 +01:00
Sarah Boyce
4cba6748a6
[5.0.x] Fixed #35087 -- Reallowed filtering against foreign keys not listed in ModelAdmin.list_filters.
...
Regression in f80669d2f5 .
Backport of a9094ec1f4 from main
2024-01-08 14:25:32 +01:00
Mariusz Felisiak
9a182f3d95
[5.0.x] Fixed #35056 -- Fixed system check crash on reverse m2m relations with related_name in ModelAdmin.filter_horizontal/vertical.
...
Thanks Thomas Feldmann for the report.
Regression in 107865780a .
Backport of 751d732a38 from main
2023-12-27 20:37:23 +01:00
David Wobrock
9aad44150f
[5.0.x] Fixed #35050 -- Fixed prefixing field names in FilteredRelation().
...
Thanks Mark Zorn for the report.
Regression in 59f4754704 .
Backport of 14917c9ae2 from main
2023-12-23 18:33:07 +01:00
Mariusz Felisiak
5f89da0837
[5.0.x] Fixed #35018 -- Fixed migrations crash on GeneratedField with BooleanField as output_field on Oracle < 23c.
...
Thanks Václav Řehák for the report.
Regression in f333e3513e .
Backport of fcf95e5927 from main.
2023-12-12 05:41:38 +01:00
Sarah Boyce
03af8fbd0f
[5.0.x] Fixed #35019 -- Fixed save() on models with both GeneratedFields and ForeignKeys.
...
Thanks Deb Kumar Das for the report.
Regression in f333e3513e .
Backport of b287af5dc9 from main
2023-12-08 12:09:56 +01:00
Mariusz Felisiak
415a08a528
[5.0.x] Fixed #35024 -- Fixed model instance creation crash on GeneratedField.output_field with backend converters.
...
Regression in d9de74141e .
This is a long standing issue, however it caused a crash of
GeneratedFields for all output fields that have backend-specific
converters when the RETURNING clause is not supported
(MySQL and SQLite < 3.35).
That's why severity was exacerbated.
Backport of 5b3b791e90 from main
2023-12-07 20:50:48 +01:00
Sarah Boyce
454fd50efb
[5.0.x] Fixed #35020 -- Fixed ModelAdmin.lookup_allowed() for non-autofield primary keys.
...
Thanks Joshua Goodwin for the report.
Regression in 45ecd9acca .
Backport of f80669d2f5 from main
2023-12-07 08:44:59 +01:00
Peter Thomassen
cb013fc7d9
[5.0.x] Fixed #35002 -- Made UniqueConstraints with fields respect nulls_distinct.
...
Regression in 595a2abb58 .
Backport of 54cb1a7e16 from main
2023-12-03 14:12:39 +01:00
Sarah Boyce
9fe12b0f36
[5.0.x] Refs #34995 -- Made Selenium tests more robust for admin_views and admin_widgets suites.
...
Depending on screen sizes, the selenium tests that would "click" or interact
with an element outside the scope of the visible window would produce test
failures (raising ElementNotInteractableException in CI runs).
This branch switches those to using ActionChains, which ensures that the click
(or other interaction) is performed only after successfully completing the
move to the relevant element.
Co-authored-by: Tom Carrick <tom@carrick.eu >
Backport of af2fd36815 from main
2023-11-30 17:09:09 -03:00
Mariusz Felisiak
7f1dc67f53
[5.0.x] Fixed #35006 -- Fixed migrations crash when altering Meta.db_table_comment on SQLite.
...
Thanks Юрий for the report.
Regression in 78f163a4fb .
Backport of 37fc832a54 from main
2023-11-30 10:11:02 +01:00
Mariusz Felisiak
92af3d4d23
[5.0.x] Refs #34380 -- Added FORMS_URLFIELD_ASSUME_HTTPS transitional setting.
...
This allows early adoption of the new default "https".
Backport of a4931cd75a from main.
2023-11-28 20:08:10 +01:00