1
0
mirror of https://github.com/django/django.git synced 2025-01-30 12:09:25 +00:00

13134 Commits

Author SHA1 Message Date
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 107865780aa44914e21d27fdf4ca269bc61c7f01.
Backport of 751d732a3815a68bdb5b7aceda0e7d5981362c4a 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 59f475470494ce5b8cbff816b1e5dafcbd10a3a3.

Backport of 14917c9ae272f47d23401100faa6cefa8e1728bf 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 f333e3513e8bdf5ffeb6eeb63021c230082e6f95.

Backport of fcf95e592774a6ededec35481a2061474d467a2b 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 f333e3513e8bdf5ffeb6eeb63021c230082e6f95.

Backport of b287af5dc954628d4b336aefc5027b2edceee64b 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 d9de74141e8a920940f1b91ed0a3ccb835b55729.

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 5b3b791e9046461901df3898be8544e14d91b931 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 45ecd9acca9b36093e274f47b6877a5f79108d9e.

Backport of f80669d2f5a5f1db9e9b73ca893fefba34f955e7 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 595a2abb58e04caa4d55fb2589bb80fb2a8fdfa1.

Backport of 54cb1a7e160089cea438f50fdb70aaaf6823786e 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 af2fd368156439b79e4c1eb2278c433246771e44 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 78f163a4fb3937aca2e71786fbdd51a0ef39629e.
Backport of 37fc832a54ad37e75a898a2c8f9ab0820617c4af 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 a4931cd75a1780923b02e43475ba5447df3adb31 from main.
2023-11-28 20:08:10 +01:00
Tom Carrick
432bfa2615 [5.0.x] Fixed #34982 -- Fixed admin's read-only password widget and help texts alignment for tablet screen size.
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>

Backport of 729266c6f29c7a0677b24926a86a767ef3078b26 from main
2023-11-27 15:20:22 -03:00
Nathaniel Conroy
d9ba8fa397 [5.0.x] Fixed #34992 -- Fixed DatabaseFeatures.allows_group_by_selected_pks on MariaDB with ONLY_FULL_GROUP_BY sql mode.
Regression in 041551d716b69ee7c81199eee86a2d10a72e15ab.

Backport of 0257426fe1fe9d146fd5813f09d909917ff59360 from main
2023-11-27 10:34:42 +01:00
Simon Charette
95dec210e8 [5.0.x] Fixed #34987 -- Fixed queryset crash when mixing aggregate and window annotations.
Regression in f387d024fc75569d2a4a338bfda76cc2f328f627.

Just like `OrderByList` the `ExpressionList` expression used to wrap
`Window.partition_by` must implement `get_group_by_cols` to ensure the
necessary grouping when mixing window expressions with aggregate
annotations is performed against the partition members and not the
partition expression itself.

This is necessary because while `partition_by` is implemented as
a source expression of `Window` it's actually a fragment of the WINDOW
expression at the SQL level and thus it should result in a group by its
members and not the sum of them.

Thanks ElRoberto538 for the report.
Backport of e76cc93b0168fa3abbafb9af1ab4535814b751f0 from main
2023-11-23 06:09:58 +01:00
Mariusz Felisiak
48eebdc63c [5.0.x] Fixed #34985 -- Fixed GeneratedFields.contribute_to_class() crash when apps are not populated.
Thanks Paolo Melchiorre for the report.

Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.
Backport of 101a85a5a06585ba16ecb25860146d034a8a55ec from main
2023-11-22 13:49:59 +01:00
Sarah Boyce
0c6ca52226 [5.0.x] Fixed #34984 -- Skipped GeneratedFields when remaking tables on SQLite.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.t

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: David Sanders <shang.xiao.sanders@gmail.com>

Backport of 828082dad954e87d09a99b53424e6faa1860ccc7 from main
2023-11-22 13:27:40 +01:00
Simon Charette
49f1ced863 [5.0.x] Fixed #34975 -- Fixed crash of conditional aggregate() over aggregations.
Adjustments made to solve_lookup_type to defer the resolving of
references for summarized aggregates failed to account for similar
requirements for lookup values which can also reference annotations
through Aggregate.filter.

Regression in b181cae2e3697b2e53b5b67ac67e59f3b05a6f0d.

Refs #25307.

Thanks Sergey Nesterenko for the report.

Backport of 7530cf3900ab98104edcde69e8a2a415e82b345a from main
2023-11-18 16:52:54 +01:00
Mariusz Felisiak
fcc55f8c26 [5.0.x] Refs #34944 -- Propagated system checks for GeneratedField.output_field.
Backport of c705625ebff0141ed2b95dd3c8174bda8270a47f from main
2023-11-14 20:22:41 +01:00
Mariusz Felisiak
ddbe5c86e8 [5.0.x] Fixed #34944 -- Made GeneratedField.output_field required.
Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.

Backport of 5875f03ce61b85dfd9ad34f7b871c231c358d432 from main
2023-11-14 20:22:33 +01:00
Mariusz Felisiak
5b1d0a6be0 [5.0.x] Reverted "Refs #30446, Refs #34944 -- Fixed crash when adding GeneratedField with string Value()."
This reverts commit 8b1acc0440418ac8f45ba48e2dfcf5126c83341b.

Backport of de4884b114534f43c49cf8c5b7f10181e737f4e9 from main
2023-11-14 15:46:23 +01:00
nessita
7a21ea5464 [5.0.x] Fixed #34958 -- Fixed isolation of messages_tests.tests.TestLevelTags.test_lazy.
Backport of 1b56b24f81a2e64b4bd3059abad9b6fd0c801c66 from main
2023-11-13 09:38:00 +01:00
Adam Johnson
8eba6efbf0 [5.0.x] Fixed #34457 -- Restored output for makemigrations --check.
Co-authored-by: David Sanders <shang.xiao.sanders@gmail.com>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>

Backport of f7389c4b07ceeb036436e065898e411b247bca78 from main
2023-11-09 10:44:07 -03:00
Simon Charette
73869a5163 [5.0.x] Refs #30446, Refs #34944 -- Fixed crash when adding GeneratedField with string Value().
This should allow smarter output_field inferring in functions dealing
with text expressions.

Regression in f333e3513e8bdf5ffeb6eeb63021c230082e6f95.

Backport of 8b1acc0440418ac8f45ba48e2dfcf5126c83341b from main
2023-11-08 16:18:00 +03:00
Simon Charette
0265eaa500 [5.0.x] Fixed #34946 -- Preserved db_default on combined default field addition.
Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.
Backport of 8a28e983df091d94eaba77cb82fbe3ef60a80799 from main
2023-11-07 13:33:24 +03:00
David Sanders
8dde0504f3 [5.0.x] Fixed #34936 -- Fixed migration crash for DecimalField with db_default on SQLite.
CAST() must be wrapped in parentheses to be recognized as an expression on SQLite.

Regression in 7414704e88d73dafbcfbb85f9bc54cb6111439d3.

Backport of 797957fb48f63760442d3d4c8985fd94f8602d5e from main
2023-11-02 19:59:39 +01:00
Tim Graham
b735b90f43 [5.0.x] Refs #31300 -- Allowed testing GeneratedField without collation.
CockroachDB and Snowflake don't support it.

Backport of 208870b6122c4cbc39c3b2432e13db54c920db51 from main
2023-11-02 15:48:31 +01:00
Mariusz Felisiak
bb71d34551 [5.0.x] Fixed CVE-2023-46695 -- Fixed potential DoS in UsernameField on Windows.
Thanks MProgrammer (https://hackerone.com/mprogrammer) for the report.
2023-11-01 06:18:00 +01:00
Tom Carrick
602835202d [5.0.x] Fixed #34932 -- Restored varchar_pattern_ops/text_pattern_ops index creation when deterministic collaction is set.
Regression in f3f9d03edf17ccfa17263c7efa0b1350d1ac9278 (4.2) and
8ed25d65ea7546fafd808086fa07e7e5bb5428fc (5.0).

Backport of 34b411762b50883d768d7b67e0a158ec39da8b09 from main
2023-10-30 11:08:03 +01:00
Mariusz Felisiak
00805ff436 [5.0.x] Fixed #34923 -- Avoided initializing LEVEL_TAGS when importing django.contrib.messages.
Regression in b7fe36ad37fb18c4bc7932c0aec6ae4f299b9622.

Thanks James Gillard for the report.

Backport of 311718feb5f1fb9ff794bbac0cda48cfc3410de8 from main
2023-10-24 14:12:40 -03:00
Nick Pope
cc5901fa8e [5.0.x] Fixed #34899 -- Added blank choice to forms' callable choices lazily.
Backport of 171f91d9ef5177850c2f12b26dd732785f6ac034 from main
2023-10-23 14:54:37 -03:00
Nick Pope
bbe90f3c00 [5.0.x] Refs #34899 -- Extracted Field.flatchoices to flatten_choices helper function.
Co-authored-by: Natalia Bidart <124304+nessita@users.noreply.github.com>

Backport of 74afcee234f8be989623ccc7c28b9fb97fb548f0 from main
2023-10-23 14:53:13 -03:00
Nick Pope
711c054722 [5.0.x] Refs #31262 -- Added __eq__() and __getitem__() to BaseChoiceIterator.
This makes it easier to work with lazy iterators used for callables,
etc. when extracting items or comparing to lists, e.g. during testing.

Also added `BaseChoiceIterator.__iter__()` to make it clear that
subclasses must implement this and added `__all__` to the module.

Co-authored-by: Adam Johnson <me@adamj.eu>
Co-authored-by: Natalia Bidart <124304+nessita@users.noreply.github.com>

Backport of 07fa79ef2bb3e8cace7bd87b292c6c85230eed05 from main
2023-10-23 14:51:27 -03:00
David Sanders
4dec7eded9 [5.0.x] Fixed #34921 -- Fixed crash of warning for unbound naive datetimes.
Backport of b5311ee23219cfb676e2e67667ecba1e5d363aa0 from main
2023-10-22 19:34:13 +02:00
laserhyena
bba963df50 [5.0.x] Fixed #34911 -- Corrected HTML heading levels on admindocs' main page.
Backport of 21382e2743d06efbf5623e7c9b6dccf2a325669b from main
2023-10-20 06:20:32 +02:00
ontowhee
31bdf67a9c [5.0.x] Fixed #34905 -- Corrected admin's main content element rendered in <main> tag.
Regression in 91e617c743b21a0ebad01f18623a8b31f6f58500.

Thanks Tom Carrick for the report.
Backport of 89d2ae257bfdbe6f32c4671d97bf572623992ace from main
2023-10-19 17:26:15 +02:00
Mariusz Felisiak
448510a94b [5.0.x] Refs #34900, Refs #34118 -- Updated assertion in test_skip_class_unless_db_feature() test on Python 3.12.1+.
Python 3.12.1+ no longer includes skipped tests in the number of
running tests. Check out:

https://github.com/python/cpython/issues/110890#issuecomment-1763458686
https://github.com/python/cpython/pull/106588
Backport of 20b7aac7ca60b0352d926340622e618bcbee54a8 from main
2023-10-16 06:28:13 +02:00
Simon Charette
4ccca9eedc [5.0.x] Fixed #34798 -- Fixed QuerySet.aggregate() crash when referencing expressions containing subqueries.
Regression in 59bea9efd2768102fc9d3aedda469502c218e9b7,
complements e5c844d6f2a4ac6ae674d741b5f1fa2a688cedf4.

Refs #28477, #34551.

Thanks Haldun Komsuoglu for the report.

Backport of 3b4a571275d967512866012955eb0b3ae486d63c from main
2023-10-16 06:15:08 +02:00
Mariusz Felisiak
c3cf518a80 [5.0.x] Refs #34840 -- Fixed test_validate_nullable_textfield_with_isnull_true() on databases that don's support table check constraints.
Thanks Tim Graham for the report.
Backport of 9fd3a0ffc8fb8e532b0d5717f99fb15aff175a6c from main
2023-10-12 20:02:02 +02:00
Mariana
0bbe6ca2ac [5.0.x] Fixed #12241 -- Preserved query strings when using "Save and continue/add another" in admin.
Co-authored-by: Grady Yu <gradyy@users.noreply.github.com>
Co-authored-by: David Sanders <shang.xiao.sanders@gmail.com>
Co-authored-by: Matthew Newton <matthewn@berkeley.edu>

Backport of fc62e17778dad9eab9e507d90d85a33d415f64a7 from main
2023-10-11 12:46:10 +02:00
Mariusz Felisiak
bcc6a8ee88 [5.0.x] Refs #34882 -- Fixed GISFunctionsTests.test_asgeojson_option_0() test on Oracle.
This uses an example with the same precision for all databases.

Follow up to 96e7a752b6c44a84e18d82d37524c1df64b32e12.
Backport of 6e369f36f2def929525e524f621eead4b041d1cf from main
2023-10-11 12:45:44 +02:00
Mariusz Felisiak
9f8bf7aebe [5.0.x] Fixed #34889 -- Fixed get_prefetch_queryset() fallback in prefetch_one_level().
Thanks Matt Westcott for the report.

Regression in cac94dd8aa2fb49cd2e06b5b37cf039257284bb0.
Backport of 296b75a3c0309a936a6c07d8f711f722e3b96e63 from main
2023-10-06 20:19:59 +02:00
Denis Rouzaud
df3f97a7d6 [5.0.x] Fixed #34882 -- Fixed no options in AsGeoJSON() for geometries in non-default CRS.
Backport of 96e7a752b6c44a84e18d82d37524c1df64b32e12 from main
2023-10-06 05:27:04 +02:00
pieterck
72a2044b40 [5.0.x] Fixed #34759 -- Confirmed support for SpatiaLite 5.1.
Thanks The Epic Dev for helping with tests.

Backport of 0989cf13e70f52d5b241aa176eb74a680a282d09 from main.
2023-10-05 18:15:47 +02:00
Simon Charette
458bc9e768 [5.0.x] Refs #33482 -- Fixed QuerySet selecting and filtering againts Exists() with empty queryset.
Thanks Tobias Bengfort for the report.
Backport of ea596a52d9f905596cc5335930c8f2ac4511204c from main
2023-10-04 21:32:35 +02:00
Natalia
8124c42601 [5.0.x] Fixed CVE-2023-43665 -- Mitigated potential DoS in django.utils.text.Truncator when truncating HTML text.
Thanks Wenchao Li of Alibaba Group for the report.
2023-10-04 09:38:26 -03:00
Dan Jacob
e60fe3bb05 [5.0.x] Fixed #34878 -- Fixed autoreloader crash when FORM_RENDERER is set to TemplatesSetting.
Regression in 439242c5943e16dd5a3a68fadac76e5e723eb323.

Backport of fe835c2355072fc2b7a0fbbc57d05477c7ee6ce9 from main
2023-09-29 06:36:59 +02:00
Paolo Melchiorre
0f9d07398d [5.0.x] Fixed #34877 -- Fixed migrations crash when adding GeneratedField with output_field with params.
Backport of e7e8eb44a30bcab004a582760752b5eb3fcd6e91 from main
2023-09-28 08:12:39 +02:00
David Sanders
bc6d71d4de [5.0.x] Fixed #34825 -- Avoided setting unused connections when initializing parallel workers.
Backport of a5905b164dbf52e59fa646af9c3d523c0804d86a from main
2023-09-25 11:10:17 +02:00
David Sanders
4910920869 [5.0.x] Fixed #34849 -- Avoided raising RuntimeWarning about import-time queries when apps are reinitialized with test tools.
Regression in fbd16438f46bc2128926958ad24331da5d1b406f.

Backport of 4f2ae0644de34791b84b7beb11a966ce4bc48fb6 from main
2023-09-25 09:14:05 +02:00
Paolo Melchiorre
81663cc4ca [5.0.x] Fixed #34861 -- Fixed crash when adding GeneratedField with some expressions.
Co-authored-by: Simon Charette <charette.s@gmail.com>

Backport of 574ee4023e15cfb195833edfbaed353f8021c62f from main
2023-09-22 21:37:01 +02:00
Arian
7683c86351 [5.0.x] Fixed #34823 -- Fixed assertTemplateUsed() context manager crash on unnamed templates.
Backport of 51d703a27fee518491adee1e07e2b857a90b2c8d from main
2023-09-22 11:46:47 +02:00