Commit Graph

12539 Commits

Author SHA1 Message Date
Marcelo Galigniana 67c34c1a37 Completed test coverage for createsuperuser command. 2022-09-27 09:57:16 +02:00
Adam Johnson cd03e8e2d6 Fixed #34050 -- Replaced invalid chars in migration names with '_'.
Thanks to Bishal Gautam for the report and initial implementation.

Regression in fa58450a9a.

Co-Authored-By: Bishal Gautam <bisalgt@gmail.com>
2022-09-27 08:02:51 +02:00
Moshe Nahmias d938b3b257
Fixed #34040 -- Removed autofocus from admin search box. 2022-09-26 21:06:48 +02:00
Mariusz Felisiak f4e592e383
Removed unnecessary MySQL workaround in timezones tests.
Unnecessary since 22da5f8817.
2022-09-26 13:36:47 +02:00
Florian Perucki 872b61193b Refs #34041 -- Added navigation landmark to breadcrumbs in admin.
Thanks Thibaud Colas for pair programming.
2022-09-26 08:51:15 +02:00
David Sanders 9f8c994851 Fixed #34027 -- Fixed migrations crash when altering type of char/text fields referenced by foreign key on PostgreSQL. 2022-09-25 20:23:01 +02:00
select-case f3822d4ab0
Fixed #34026 -- Fixed WKBReader.read() crash on string input. 2022-09-24 17:16:08 +01:00
David Sanders 1674c70525
Fixed #34024 -- Fixed crash when aggregating querysets with Q objects annotations.
This reverts b64db05b9c.

It was reasonable to assume it was unnecessary code as there were
no failing tests upon its removal. This commit adds the necessary
regression tests for the failing condition identified in #34024
alongside the original tests added in the PR for which
WhereNode.is_summary was introduced.
2022-09-23 15:15:03 +01:00
Mariusz Felisiak 37a13cc92d
Refs #34012 -- Added test for ordering by transform of related fields. 2022-09-22 12:55:47 +02:00
Mariusz Felisiak ce6230aa97
Fixed #34015 -- Allowed filtering by transforms on relation fields. 2022-09-22 00:17:04 +02:00
Alexander Kerkum f88fc72da4 Fixed #34016 -- Fixed QuerySet.values()/values_list() crash on ArrayAgg() and JSONBAgg().
Regression in e06dc4571e.
2022-09-17 19:38:20 +02:00
Kamil Turek ae509f8f08 Fixed #34014 -- Fixed DecimalValidator validating 0 in positive exponent scientific notation.
Thanks Shiplu Mokaddim for the report.
2022-09-17 10:02:55 +02:00
Mariusz Felisiak 229360d7ad
Fixed test_relational_post_delete_signals_happen_before_parent_object when run in isolation. 2022-09-16 11:14:27 +02:00
Allen Jonathan David 10178197d5 Fixed #33966 -- Added support for using KeyTextTransform from lookup. 2022-09-16 05:36:57 +02:00
Anvesh Mishra 6220c445c4 Fixed #29186 -- Fixed pickling HttpRequest and subclasses. 2022-09-14 13:04:34 +02:00
David Sanders e14d08cd89 Fixed #33996 -- Fixed CheckConstraint validation on NULL values.
Bug in 667105877e.

Thanks James Beith for the report.
2022-09-13 12:48:31 +02:00
Sergey Fursov b731e88415 Fixed #31335 -- Fixed removing composed composed Meta constraints/indexes on foreign keys on MySQL. 2022-09-13 10:38:57 +02:00
Sergey Fursov 1b08e9bf7d Refs #31335 -- Added more tests for removing composed Meta constraints/indexes on foreign keys. 2022-09-12 13:52:06 +02:00
Jimmy Angelakos 07ebef566f Refs #34000 -- Optimized handling None values in numberformat.format(). 2022-09-12 13:02:50 +02:00
Jimmy Angelakos e911e0996f Fixed #34000 -- Fixed numberformat.format() crash on empty strings. 2022-09-12 12:54:12 +02:00
DevilsAutumn f3cd252cfc Fixed #33995 -- Fixed FormSet.empty_form crash when empty_permitted is passed to form_kwargs. 2022-09-09 13:51:47 +02:00
DevilsAutumn 32797e7fbf Fixed #33975 -- Fixed __in lookup when rhs is a queryset with annotate() and alias().
This fixes clearing selected fields.
2022-09-09 08:37:46 +02:00
Simon Charette 32536b1324 Fixed #33992 -- Fixed queryset crash when aggregating over a group containing Exists.
A more in-depth solution is likely to make sure that we always GROUP BY
selected annotations or revisit how we use Query.exists() in the Exists
expression but that requires extra work that isn't suitable for a
backport.

Regression in e5a92d400a.

Thanks Fernando Flores Villaça for the report.
2022-09-08 05:50:02 +02:00
Mariusz Felisiak a2e580acf6
Refs #24179 -- Fixed selenium tests for offset of admin selector boxes in fieldset.
Regression in be63c78760.
2022-09-07 12:02:08 +02:00
James Beith 19e838daa8 Fixed #33982 -- Fixed migrations crash when adding model with ExclusionConstraint.
Regression in 0e656c02fe.
2022-09-07 08:40:56 +02:00
SirAbhi13 4a1150b41d Fixed #33616 -- Allowed registering callbacks that can fail in transaction.on_commit().
Thanks David Wobrock and Mariusz Felisiak for reviews.
2022-09-06 12:21:36 +02:00
Mariusz Felisiak 69fa2e8eb2
Refs #26780 -- Made prefetch_related() don't use window expressions fo sliced queries if not supported. 2022-09-06 05:54:35 +02:00
Mark Evans 19e0587ee5 Fixed #33937 -- Optimized serialization of related m2m fields without natural keys. 2022-09-05 20:23:32 +02:00
Allen Jonathan David cd1afd553f Fixed #29799 -- Allowed registering lookups per field instances.
Thanks Simon Charette and Mariusz Felisiak for reviews and mentoring
this Google Summer of Code 2022 project.
2022-09-02 10:02:24 +02:00
Shai Berger fdf0f62521 Fixed ReadOnlyPasswordHashWidget's template for RTL languages. 2022-09-01 21:20:15 +02:00
Mariusz Felisiak 974942a750
Fixed #33955, Fixed #33971 -- Reverted "Fixed #32565 -- Moved internal URLResolver view-strings mapping to admindocs."
This reverts commit 7f3cfaa12b.

Thanks Tom Carrick and Greg Kaleka for reports.
2022-09-01 21:09:16 +02:00
Allen Jonathan David e64919ae54 Refs #29799 -- Added more tests for registering lookups. 2022-09-01 09:59:31 +02:00
Simon Charette b3db6c8dcb Fixed #21204 -- Tracked field deferrals by field instead of models.
This ensures field deferral works properly when a model is involved
more than once in the same query with a distinct deferral mask.
2022-08-30 08:43:53 +02:00
Simon Charette 5d12650ed9 Refs #21204 -- Added more QuerySet.defer()/only() tests for invalid fields. 2022-08-30 07:09:15 +02:00
Mariusz Felisiak a9e7beb959
Refs #33953 -- Fixed test_rename_model_with_db_table_rename_m2m() crash on SQLite < 3.20. 2022-08-29 10:07:53 +02:00
Mariusz Felisiak f210de760b
Refs #28333 -- Fixed NonQueryWindowTests.test_invalid_filter() on databases that don't support window expressions. 2022-08-29 09:14:56 +02:00
Mohamed Karam b92ffebb0c Fixed #33954 -- Prevented models.DecimalField from accepting NaN, Inf, and -Inf values. 2022-08-27 15:51:08 +02:00
David Wobrock 806e9e2d0d Fixed #33952 -- Reallowed creating reverse foreign key managers on unsaved instances.
Thanks Claude Paroz for the report.

Regression in 7ba6ebe914.
2022-08-27 15:03:48 +02:00
Simon Charette 0701bb8e1f Fixed #33928 -- Avoided unnecessary queries when cascade updating.
Models that use SET, SET_NULL, and SET_DEFAULT as on_delete handler
don't have to fetch objects for the sole purpose of passing them back to
a follow up UPDATE query filtered by the retrieved objects primary key.

This was achieved by flagging SET handlers as _lazy_ and having the
collector logic defer object collections until the last minute. This
should ensure that the rare cases where custom on_delete handlers are
defined remain uncalled when when dealing with an empty collection of
instances.

This reduces the number queries required to apply SET handlers from
2 to 1 where the remaining UPDATE use the same predicate as the non
removed SELECT query.

In a lot of ways this is similar to the fast-delete optimization that
was added in #18676 but for updates this time. The conditions only
happen to be simpler in this case because SET handlers are always
terminal. They never cascade to more deletes that can be combined.

Thanks Renan GEHAN for the report.
2022-08-27 14:25:55 +02:00
Iuri de Silvio 166a3b3263 Fixed #33953 -- Reverted "Fixed #33201 -- Made RenameModel operation a noop for models with db_table."
Regression in afeafd6036.
This reverts afeafd6036.

Thanks Timothy Thomas for the report.
2022-08-26 06:14:44 +02:00
Simon Charette 71902e0d9f Fixed #33938 -- Fixed migration crash for m2m with a through model in another app.
Regression in aa4acc164d.

Thanks bryangeplant for the report.
2022-08-25 10:03:57 +02:00
Neeraj Kumar 9942f3fb49 Fixed #33830 -- Fixed VariableDoesNotExist when rendering ClearableFileInput. 2022-08-25 07:52:36 +02:00
Willem Van Onsem 16fffc829c Fixed #33916 -- Added support for serialization of enum.Flag in migrations. 2022-08-25 06:43:48 +02:00
Simon Charette b30c0081d4 Refs #27412 -- Confirmed support for executing Coalesce(subquery).
This has been supported for subqueries wrapped in Subquery since the expression
was introduced and for Queryset directly since Subquery resolves to sql.Query.

Piggy-backed on the existing tests covering Coalesce handling of EmptyResultSet
as it seemed like a proper location to combine testing.
2022-08-24 12:30:47 +02:00
David Wobrock 897f38fabe Fixed #33927 -- Fixed crash when displaying ArrayField with choices in admin. 2022-08-23 15:51:42 +02:00
Claude Paroz 4488a25cc9 Removed unused path variable in model_fields tests. 2022-08-23 15:34:07 +02:00
Claude Paroz 903ac2f364 Fixed #33949 -- Fixed fixture dirs duplicates with Path instances. 2022-08-23 13:24:18 +02:00
Mariusz Felisiak e9fd2b5724
Refs #26511 -- Fixed json.KeyTextTransform() on MySQL/MariaDB. 2022-08-18 21:02:29 +02:00
Tom Carrick bd36023100 Used CSS flex for admin's submit row. 2022-08-18 12:29:40 +02:00
Benoît Vinot e3cb8bcb7d Fixed #33932 -- Fixed altering AutoFields to OneToOneField on PostgreSQL.
Regression in 2eea361eff.
2022-08-17 17:06:00 +02:00