Commit Graph

13058 Commits

Author SHA1 Message Date
Simon Charette 2ee01747c3 Refs #34551 -- Fixed QuerySet.aggregate() crash on precending aggregation reference.
Regression in 1297c0d0d7.

Refs #31679.
2023-05-23 06:25:27 +02:00
Andrii Kohut f8172f45fc Fixed #34587 -- Allowed customizing table name normalization in inspectdb command. 2023-05-22 16:48:06 +02:00
Arthur Moreira 061a8a1bd8 Fixed #34577 -- Added escapeseq template filter. 2023-05-22 09:58:03 +02:00
Ben Lomax 00f5d2d110 Refs #31949 -- Made @xframe_options_(deny/sameorigin/exempt) decorators to work with async functions. 2023-05-20 15:52:00 +02:00
Ben Lomax b43936f2ec Moved clickjacking decorator tests into decorators/test_clickjacking.py.
This also adds extra assertions.
2023-05-20 15:23:52 +02:00
rajeeshp a2da81fe08 Fixed #34578 -- Made "join" template filter respect autoescape for joiner. 2023-05-19 13:16:42 +02:00
HappyDingning 674c23999c Fixed #34565 -- Added support for async checking of user passwords. 2023-05-18 09:39:04 +02:00
Carlton Gibson 4a5753fb0a
Refs #32339 -- Fixed super() call in deprecated renderers.
Missing function call `()` leads to:

TypeError: descriptor '__init__' of 'super' object needs an argument

Regression in b209518089.
2023-05-17 11:11:43 -03:00
Mariusz Felisiak c52f4295f2
Fixed #34568 -- Made makemigrations --update respect --name option.
Thanks David Sanders for the report.
2023-05-17 13:14:43 +02:00
Simon Charette 99e5dff737 Fixed #34570 -- Silenced noop deferral of many-to-many and GFK.
While deferring many-to-many and GFK has no effect, the previous
implementation of QuerySet.defer() ignore them instead of crashing.

Regression in b3db6c8dcb.

Thanks Paco Martínez for the report.
2023-05-17 08:06:11 +02:00
Julie Rymer 0ec60661e6 Fixed #34539 -- Restored get_prep_value() call when adapting JSONFields.
Regression in 5c23d9f0c3.
2023-05-16 08:26:41 +02:00
Ian Foote 7414704e88 Fixed #470 -- Added support for database defaults on fields.
Special thanks to Hannes Ljungberg for finding multiple implementation
gaps.

Thanks also to Simon Charette, Adam Johnson, and Mariusz Felisiak for
reviews.
2023-05-12 19:11:40 +02:00
Mariusz Felisiak 72a86ceb33
Fixed #34558 -- Fixed QuerySet.bulk_create() crash with Now() on Oracle. 2023-05-11 18:22:55 +02:00
Simon Charette ffff17d4b0 Fixed #34553 -- Fixed improper % escaping of literal in constraints.
Proper escaping of % in string literals used when defining constaints
was attempted (a8b3f96f6) by overriding quote_value of Postgres and
Oracle schema editor. The same approach was used when adding support for
constraints to the MySQL/MariaDB backend (1fc2c70).

Later on it was discovered that this approach was not appropriate and
that a preferable one was to pass params=None when executing the
constraint creation DDL to avoid any form of interpolation in the first
place (42e8cf47).

When the second patch was applied the corrective of the first were not
removed which caused % literals to be unnecessary doubled. This flew
under the radar because the existings test were crafted in a way that
consecutive %% didn't catch regressions.

This commit introduces an extra test for __exact lookups which
highlights more adequately % doubling problems but also adjust a
previous __endswith test to cover % doubling problems (%\% -> %%\%%).

Thanks Thomas Kolar for the report.

Refs #32369, #30408, #30593.
2023-05-10 17:25:57 +02:00
Simon Charette e0f8104a96 Refs #34553 -- Split constraint escaping test in subtests.
This ensures that constraint violations are tested in isolation from
each other as an IntegrityError only ensures a least one constraint is
violated.

For example, the assertion added in 42e8cf4 break both the
name_constraint_rhs and the rebate_constraint constraints and thus
doesn't constitute a proper regression test. Refs #32369.
2023-05-10 17:25:57 +02:00
Mariusz Felisiak 6e32d1fa1d
Fixed #34554 -- Fixed Reverse(Value(…)) crash on Oracle. 2023-05-10 17:22:45 +02:00
Akash Kumar Sen 92f0017133 Refs #34534 -- Reduced Add/RemoveConstraint and Add/RenameIndex operations when optimizing migrations. 2023-05-09 12:45:09 +02:00
Mariusz Felisiak 1586a09b79
Fixed #34544 -- Avoided DBMS_LOB.SUBSTR() wrapping with IS NULL condition on Oracle.
Regression in 09ffc5c121.

Thanks Michael Smith for the report.

This also reverts commit 1e4da43955.
2023-05-08 19:34:30 +02:00
Mariusz Felisiak fcfbf08abe
Fixed MultipleFileFieldTest.test_file_multiple_validation() test if Pillow isn't installed.
Follow up to fb4c55d9ec.
2023-05-04 08:09:02 +02:00
Jan Pieter Waagmeester f5b39b77e3 Fixed #34535 -- Fixed SQLite dbshell crash on pathlib.Path when handling CommandError.
Regression in 5b884d45ac.
2023-05-04 06:07:12 +02:00
Mariusz Felisiak fb4c55d9ec Fixed CVE-2023-31047, Fixed #31710 -- Prevented potential bypass of validation when uploading multiple files using one form field.
Thanks Moataz Al-Sharida and nawaik for reports.

Co-authored-by: Shai Berger <shai@platonix.com>
Co-authored-by: nessita <124304+nessita@users.noreply.github.com>
2023-05-03 13:42:00 +02:00
Mariusz Felisiak 8e2460d599
Fixed #34529, Refs #34525 -- Reduced index operations with Meta.indexes/index_together when optimizing migrations.
This makes squashing migrations an available path for changing
Meta.index_together, which is deprecated, to Meta.indexes.

Follow up to f810325721.
2023-05-03 13:06:19 +02:00
Orhan Hirsch ea53e7c09f Fixed #34517 -- Avoided connection post_init signal to ImageField without width/height fields. 2023-05-03 06:35:19 +02:00
Paul Brown 3b62d8c83e
Refs #31369 -- Improved hint message in NullBooleanField's deprecation warning. 2023-05-02 15:42:11 -03:00
Bakdolot c61219a7ae
Fixed #34513 -- Added system check for relational fields in ModelAdmin.list_display. 2023-05-02 06:46:22 +02:00
Mariusz Felisiak 0e444e84f8 Fixed #34515 -- Made LocaleMiddleware prefer language from paths when i18n patterns are used.
Regression in 94e7f471c4.

This reverts commit 94e7f471c4
(refs #34069) and
partly reverts commit 3b4728310a.

Thanks Anthony Baillard for the report.

Co-Authored-By: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2023-05-02 06:04:18 +02:00
Mariusz Felisiak 191f6a9a45
Fixed #34528 -- Reduced Add/RemoveIndex operations when optimizing migrations. 2023-05-01 18:57:24 +02:00
4the4ryushin 0b0998dc15 Fixed #33759 -- Avoided unnecessary subquery in QuerySet.delete() with self-referential subqueries if supported. 2023-05-01 10:20:20 +02:00
Coen van der Kamp 7bbbadc693 Fixed #34380 -- Allowed specifying a default URL scheme in forms.URLField.
This also deprecates "http" as the default scheme.
2023-04-28 06:58:10 +02:00
Marc Gibbons 070cbac0db
Restored multiprocessing concurrency on coverage.py settings
* Revert "Reverted "Fixed #33213 -- Doc'd testing code coverage in parallel and used it.""

This reverts commit 78da5ca0c1.

* Restored coverage multiprocess concurrency with threads

Investigating https://github.com/nedbat/coveragepy/issues/1585 revealed
that thread tracing gets disabled when passing
`concurrency = multiprocessing`. Adding `thread` restores it, and
ensures that the `auser()` is reported as covered since the test suite
uses `AsyncToSync` to execute this middleware (which spawns threads).
2023-04-27 17:02:55 -03:00
Mariusz Felisiak 720abed343
Avoided creating default form fields in fields_for_model() when declared on form. 2023-04-27 15:26:23 +02:00
David Sanders 7d0e566208
Fixed #34518 -- Fixed crash of random() template filter with an empty list. 2023-04-26 14:17:57 +02:00
Mariusz Felisiak 9440f6ba41
Fixed #34512 -- Restored breadcrumbs on admin app index view.
Thanks Adam (ataylor32) for the report.

Regression in 872b61193b.
2023-04-26 08:36:56 +02:00
Claude Paroz 453cfa2815 Replaced docutils link by PyPI reference. 2023-04-25 12:41:06 +02:00
Ben Lomax 4dfc6ff8a8 Refs #31949 -- Made @never_cache and @cache_control() decorators to work with async functions.
Thanks Carlton Gibson and Mariusz Felisiak for reviews.
2023-04-25 10:08:03 +02:00
Ben Lomax a14ddc8cfc Added more tests for @cache_control decorator. 2023-04-25 10:04:49 +02:00
Bakdolot c813fb327c
Fixed #34481 -- Added system check for reverse related fields in ModelAdmin.list_display. 2023-04-24 08:14:35 -03:00
Simon Charette d660cee5bc Fixed #33766 -- Resolved FilteredRelation.condition at referencing time.
The previous implementation resolved condition at Join compilation time
which required introducing a specialized expression resolving mode to
alter the join reuse logic solely during that phase.

FilteredRelation.condition is now resolved when the relation is first
referenced which maintains the existing behavior while allowing the
removal of the specialized resolving mode and address an issue where
conditions couldn't spawn new joins.
2023-04-24 08:32:44 +02:00
Petter Friberg 8ed25d65ea Fixed #34505 -- Skipped varchar_pattern_ops/text_pattern_ops index creation when db_collation is set in related field. 2023-04-21 10:31:22 +02:00
Mariusz Felisiak 765b96734c Added SchemaTests._add_ci_collation() hook. 2023-04-21 10:00:09 +02:00
Marcelo Galigniana 8a6c0203c4 Fixed #34488 -- Made ClearableFileInput preserve "Clear" checked attribute when form is invalid. 2023-04-21 07:48:27 +02:00
Hielke Walinga fb535e0a90 Fixed #34496 -- Fixed handling source maps with data URI in ManifestStaticFilesStorage.
Regression in 781b44240a.
2023-04-21 05:42:06 +02:00
David Wobrock 8b1ff0da4b Refs #16055 -- Deprecated get_joining_columns()/get_reverse_joining_columns() methods. 2023-04-18 12:46:27 +02:00
David Wobrock 9bbf97bcdb Fixed #16055 -- Fixed crash when filtering against char/text GenericRelation relation on PostgreSQL. 2023-04-18 12:41:14 +02:00
sarahboyce 594fcc2b74 Fixed #22569 -- Made ModelAdmin.lookup_allowed() respect get_list_filter().
Thank you Simon Meers for the initial patch.
2023-04-17 14:09:38 +02:00
Mariusz Felisiak 198a19b692
Refs #34483 -- Fixed timesince()/timeuntil() with timezone-aware dates on different days and interval less than 1 day.
Follow up to 813015d67e.
Regression in 8d67e16493.
2023-04-14 17:41:03 +02:00
Scott Macpherson 53aee470d5 Fixed #34486 -- Fixed DatabaseOperations.compose_sql() crash with no existing database connection on PostgreSQL.
Regression in 09ffc5c121.
2023-04-14 10:11:33 +02:00
nessita 813015d67e
Fixed #34483 -- Fixed timesince()/timeuntil() with timezone-aware dates and interval less than 1 day.
Regression in 8d67e16493.

Thanks Lorenzo Peña for the report.
2023-04-13 13:16:33 -03:00
Mariusz Felisiak 173034b005 Refs #34482 -- Reverted "Fixed #32969 -- Fixed pickling HttpResponse and subclasses."
This reverts commit d7f5bfd241.

Thanks Márton Salomváry for the report.
2023-04-12 18:52:43 +02:00
Mariusz Felisiak 280ca147af Fixed #34484, Refs #34482 -- Reverted "Fixed #29186 -- Fixed pickling HttpRequest and subclasses."
This reverts commit 6220c445c4.

Thanks Adam Johnson and Márton Salomváry for reports.
2023-04-12 18:52:43 +02:00
Marcelo Galigniana dfc720c521 Fixed #27505 -- Allowed customizing Paginator's error messages. 2023-04-12 14:02:28 +02:00
sarahboyce 041b0a359a Fixed #34394 -- Added FORCE_SCRIPT_NAME handling to ASGIRequest.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-04-12 12:50:48 +02:00
Jacob Walls c3d7a71f83 Fixed #34480 -- Fixed crash of annotations with Chr(). 2023-04-11 05:56:47 +02:00
sarahboyce 3b4728310a Fixed #34455 -- Restored i18n_patterns() respect of prefix_default_language argument when fallback language is used.
Regression in 94e7f471c4.

Thanks Oussama Jarrousse for the report.
2023-04-10 08:49:54 +02:00
Mariusz Felisiak 2eb1f37260
Refs #34118 -- Fixed CustomChoicesTests.test_uuid_unsupported on Python 3.11.4+.
5342f5e713

Follow up to 38e63c9e61.
2023-04-07 11:07:54 +02:00
Mariusz Felisiak 5b8a043bf5
Fixed #34470 -- Enforced UTF-8 encoding on PostgreSQL.
Regression in 6a21658163.
2023-04-07 10:11:41 +02:00
Anders Kaseorg 73cbb372ba Fixed #34466 -- Reallowed setting cursor_factory in DATABASES["options"] on PostgreSQL.
Regression in 09ffc5c121.
2023-04-07 08:02:34 +02:00
Simon Charette 9daf8b4109 Fixed #34464 -- Fixed queryset aggregation over group by reference.
Regression in 59bea9efd2.

Refs #28477.

Thanks Ian Cubitt for the report.
2023-04-07 06:57:32 +02:00
Mariusz Felisiak 4bf4222010 Fixed #34459 -- Fixed SearchVector() crash for parameters with % symbol.
Thanks Patryk Zawadzki for the report.

Regression in 09ffc5c121.
2023-04-06 13:32:47 +02:00
Mariusz Felisiak 02a04ab79a Moved SearchVectorIndexTests.test_search_vector_index to postgres_tests.test_indexes. 2023-04-06 13:32:47 +02:00
Mariusz Felisiak 38e63c9e61
Refs #34118 -- Fixed CustomChoicesTests.test_uuid_unsupported on Python 3.12+.
2a4d8c0a9e
2023-04-05 13:59:10 +02:00
Simon Charette 87c63bd8df Fixed #34458 -- Fixed QuerySet.defer() crash on attribute names.
Thanks Andrew Cordery for the report.

Regression in b3db6c8dcb.
2023-04-05 05:38:10 +02:00
Simon Charette 0e1aae7a5f Fixed #34450 -- Fixed multi-valued JOIN reuse when filtering by expressions.
Thanks Roman Odaisky for the report.
2023-04-04 14:35:21 +02:00
Ben Lomax f2b97fbf06 Moved cache decorators tests into decorators/test_cache.py. 2023-04-04 09:53:31 +02:00
th3nn3ss 1d1ddffc27 Fixed #33738 -- Allowed handling ASGI http.disconnect in long-lived requests. 2023-04-03 14:01:48 +02:00
Ran Benita 066aabcb77 Fixed #34445 -- Fixed string-casting of non-string lazy objects.
This removes __text_cast() as it's the same as __cast().
_delegate_bytes and __delegate_text are mutually exclusive so the
`if self._delegate_bytes` branch in __cast() is unreachable.

Co-Authored-By: David Sanders <shang.xiao.sanders@gmail.com>
2023-03-30 11:42:10 +02:00
Mariusz Felisiak 7330408ac3
Reverted "Refs #31949 -- Enabled @sensitive_variables to work with async functions."
This reverts commits 23cbed2187 and
203a15cadb.
2023-03-30 10:22:23 +02:00
David Sanders 5dba5fda55
Fixed #34427 -- Improved error message when context processor does not return a dict. 2023-03-29 08:54:04 +02:00
Mariusz Felisiak 996c802229
Fixed #34443 -- Fixed filtering by transforms on reverse relations.
Regression in ce6230aa97.
2023-03-28 21:03:24 +02:00
Mariusz Felisiak 3afdc9e9b4
Refs #29799 -- Added field instance lookups to suggestions in FieldErrors.
Bug in cd1afd553f.
2023-03-28 19:18:48 +02:00
Gary Jarrel fcc7dc5781 Fixed #34438 -- Reallowed extending UserCreationForm.
Regression in 298d02a77a.
2023-03-28 11:33:20 +02:00
sarahboyce 45ecd9acca Fixed #28384 -- Fixed ModelAdmin.lookup_allowed() for OneToOneField primary keys and nested relations. 2023-03-28 09:26:39 +02:00
Tom Carrick d687febce5 Fixed #34383 -- Fixed layout of admin fieldsets with multiple fields on the same line.
Thanks Antonio Candido Nazareth junior for the report.

Regression in 96a598356a.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-03-27 14:05:24 +02:00
David Wobrock 21757bbdcd Refs #28948 -- Removed superfluous messages from cookie through bisect. 2023-03-27 09:22:00 +02:00
David Wobrock 9d0c878abf Refs #28948 -- Precomputed once serialized cookie messages.
When the cookie size is too long, the same messages were serialized
over and over again.
2023-03-27 09:14:54 +02:00
David Wobrock 67208a5ad6 Fixed typo in tests/messages_tests/test_cookie.py. 2023-03-27 08:55:48 +02:00
Simon Charette cb13792938
Fixed #34437 -- Made values() resolving error mention selected annotations.
While the add_fields() call from set_values() does trigger validation it
does so after annotations are masked resulting in them being excluded
from the choices of valid options surfaced through a FieldError.
2023-03-25 20:22:45 +01:00
David Smith cad376f844 Fixed #34077 -- Added form field rendering. 2023-03-24 10:16:30 +01:00
David Wobrock d6b6e5d0fd Fixed #28553 -- Fixed annotation mismatch with QuerySet.values()/values_list() on compound queries.
Co-authored-by: Matthias Kestenholz <mk@feinheit.ch>
2023-03-24 06:09:27 +01:00
Jon Janzen 23cbed2187
Refs #31949 -- Enabled @sensitive_variables to work with async functions. 2023-03-22 10:21:04 +01:00
Jure Slak d22209cb42 Fixed #34424 -- Fixed SelectDateWidget crash for inputs raising OverflowError. 2023-03-22 07:59:39 +01:00
Jure Slak b4870e7196 Refs #34434 -- Added assertion for cleaning 0-0-0 for forms.DateField. 2023-03-22 07:50:03 +01:00
Carlton Gibson 02c356f2f3
Fixed #34428 -- Made ASGIStaticFilesHandler adapt response to async iterator.
Bug in 0bd2c0c901.
2023-03-21 20:51:53 +01:00
T. Franzel a2eaea8f22 Fixed #34388 -- Allowed using choice enumeration types directly on model and form fields. 2023-03-21 19:44:41 +01:00
David Smith 051d5944f8 Refs #33134, Refs #34077 -- Adjusted form rendering recursion test.
Adjusted recursion depth test to use str() rather than the form or
field’s render() method.
2023-03-21 15:12:56 +01:00
Liyang Zhang f9f9215d3e
Fixed some typos in comments, docstrings, and tests. 2023-03-20 08:07:23 +01:00
Andy Chosak b295b31171 Fixed #34420 -- Corrected the order of imports in generated migration files. 2023-03-20 06:23:08 +01:00
Mariusz Felisiak e10c1688f9
Fixed #34322 -- Made ES module support to ManifestStaticFilesStorage optional.
Co-authored-by: Author: Claude Paroz <claude@2xlibre.net>
2023-03-18 14:05:41 +01:00
hb6h057 2ffa815c73 Fixed #34421 -- Fixed QuerySet.update() on querysets in descending order by annotations. 2023-03-18 13:19:40 +01:00
sarahboyce d2b688b966 Fixed #1873 -- Handled multi-valued query parameters in admin changelist filters. 2023-03-16 08:38:44 +01:00
sarahboyce 8d6f959be2 Refs #1873 -- Added test for IncorrectLookupParameters when list of values is passed to RelatedFieldListFilter. 2023-03-16 08:34:26 +01:00
Mariusz Felisiak 78da5ca0c1
Reverted "Fixed #33213 -- Doc'd testing code coverage in parallel and used it."
This reverts commit 69352d85fa.

Test coverage for async methods was no longer calculated with this
change.
2023-03-15 13:05:48 +01:00
David Wobrock de0c7744be Refs #28329 -- Fixed Cast() with ForeignKey to integer fields on MySQL. 2023-03-14 08:32:17 +01:00
Mariusz Felisiak 254ad2e345
Fixed #34405 -- Fixed setting Content-Type header in FileResponse for compress and brotli.
Thanks Chamal De Silva for the report.
2023-03-14 05:45:30 +01:00
Claude Paroz 03bc92af97 Fixed #34407 -- Reported filename when decoding fails in collectstatic's post_process. 2023-03-12 16:54:20 +01:00
Durval Carvalho 4b1bfea284 Fixed #34333 -- Fixed migration operations ordering when adding index/constraint on new foreign key.
Thanks Simon Charette and David Wobrock for reviews.
2023-03-10 07:05:11 +01:00
Simon Charette dde2537fbb Fixed #27397 -- Prevented integer overflows on integer field lookups.
This prevents a sqlite3 crash and address a potential DDoS vector on
PostgreSQL caused by full-table-scans on overflows.
2023-03-09 15:55:10 +01:00
Hrushikesh Vaidya a52bdea5a2 Fixed #33985 -- Used app_config.verbose_name in ContentType.__str__(). 2023-03-09 10:27:08 +01:00
David Wobrock 2396933ca9 Fixed #34384 -- Fixed session validation when rotation secret keys.
Bug in 0dcd549bbe.

Thanks Eric Zarowny for the report.
2023-03-08 10:48:04 +01:00
Carlton Gibson 9b22457987
Refs #32172 -- Used asgiref coroutine shim in async signals tests.
Bug in e83a88566a.
2023-03-08 09:53:25 +01:00
Jon Janzen e846c5e724 Fixed #31920 -- Made AuthenticationMiddleware add request.auser(). 2023-03-07 13:11:22 +01:00
Jon Janzen e83a88566a Fixed #32172 -- Adapted signals to allow async handlers.
co-authored-by: kozzztik <kozzztik@mail.ru>
co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2023-03-07 08:39:25 +01:00
David Smith 507bc13648 Refs #34381 -- Fixed InspectDBTransactionalTests.test_foreign_data_wrapper() on Windows. 2023-03-06 13:40:35 +01:00
David Smith b05dfc2894
Refs #34381, Refs #10929 -- Fixed postgres_tests.test_aggregates.TestGeneralAggretate.test_empty_result_set() on PostgreSQL 14+.
Follow up to 0be8095b25.
2023-03-05 19:06:21 +01:00
Mariusz Felisiak 2660bc19f3
Refs #32539 -- Fixed facet filter tests on Oracle.
Follow up to 868e2fcdda.
2023-03-05 13:19:09 +01:00
Mariusz Felisiak 61f599aeb9
Refs #34381 -- Fixed isolation of MigrateTests.test_migrate_fake_initial(). 2023-03-04 13:09:38 +01:00
sarahboyce 868e2fcdda Fixed #32539 -- Added toggleable facet filters to ModelAdmin.
Thanks Carlton Gibson, Simon Willison, David Smith, and Mariusz
Felisiak for reviews.
2023-03-03 20:24:57 +01:00
sarahboyce 50ca4defcb Added test for preserving popup by reset link in the admin changelist. 2023-03-03 10:18:15 +01:00
Mariusz Felisiak 52e54860bf
Moved duplicate user declarations to setUpTestData() in AdminSiteFinalCatchAllPatternTests. 2023-03-03 10:08:06 +01:00
Dominique Bischof 17e08b2177 Fixed #34377 -- Fixed preserving query strings in AdminSite.catch_all_view().
Included full path when redirecting with append slash to include query
strings.

Regression in ba31b01034.
2023-03-03 08:18:54 +01:00
Dominique Bischof 4338b6526d Refs #31747 -- Added more tests for preserving query strings when redirect with APPEND_SLASH in admin. 2023-03-03 08:18:54 +01:00
Ekaterina Vahrusheva 55bcbd8d17 Fixed #34378 -- Made QuerySet.in_bulk() not clear odering when id_list is passed.
This reverts 340eaded4e.
2023-03-03 06:00:10 +01:00
Heath Henley 56e5ea805b
Fixed #34374 -- Fixed GIS tests on Windows. 2023-03-02 19:14:24 +01:00
Simon Charette c67ea79aa9 Fixed #34368 -- Made subquery raise NotSupportedError when referencing outer window expression.
Regression in f387d024fc.

Co-authored-by: Jannis Vajen <jvajen@gmail.com>
2023-02-27 07:18:58 +01:00
Simon Charette b15f162f25
Fixed #34372 -- Fixed queryset crash on order by aggregation using OrderBy.
Regression in 278881e376 caused by a lack
of expression copying when an OrderBy expression is explicitly provided.

Thanks Jannis Vajen for the report and regression test.
2023-02-27 07:10:19 +01:00
Laurent Tramoy 2276ec8c21 Fixed #34366 -- Reduced AlterField operations when optimizing migrations. 2023-02-24 13:59:42 +01:00
Mariusz Felisiak 2c428b37ae
Refs #34338 -- Fixed isolation of constraints tests.
Regression in 5b3d3e400a.
2023-02-24 09:02:45 +01:00
Tim Graham 40e88ae8c8
Refs #34320 -- Added skipIf for a test requiring check constraints. 2023-02-24 06:00:00 +01:00
Mariusz Felisiak 16c966ff7f
Refs #30060, Refs #34217 -- Made SchemaEditor not generate SQL for CheckConstraint if not supported.
The new logic mirrors the logic in SchemaEditor._delete_check_sql()
added in 68ef274bc5.

Thanks Tim Graham for the report.
2023-02-23 21:12:17 +01:00
Xavier Fernandez 5b3d3e400a Fixed #34338 -- Allowed customizing code of ValidationError in BaseConstraint and subclasses. 2023-02-23 10:58:20 +01:00
Xavier Fernandez 51c9bb7cd1 Refs #33829 -- Added violation_error_message to constraints' __repr__(). 2023-02-23 05:35:58 +01:00
Panagiotis H.M. Issaris dcd9746983
Fixed #34363 -- Fixed floatformat crash on zero with trailing zeros.
Regression in 08c5a78726.
Follow up to 4b066bde69.
2023-02-22 20:46:16 +01:00
Xavier Fernandez ad18a0102c Fixed #34355 -- Deprecated passing positional arguments to BaseConstraint. 2023-02-22 09:37:58 +01:00
Mariusz Felisiak 96bc4254ee
Refs #31445 -- Added test for nesting QuerySet.union().
This was fixed in MySQL 8.0.31.
2023-02-21 12:47:52 +01:00
Mariusz Felisiak 5afd8c6940
Refs #16969 -- Added test for not initializing PostGIS-specific stuff for non-db connections. 2023-02-21 08:42:28 +01:00
Laurens Verhoeven 6cbc403b8e Fixed #34349 -- Fixed FormSet.empty_form crash when deleting extra forms is disabled. 2023-02-20 09:04:29 +01:00
Simon Charette 278881e376 Fixed #34346 -- Ordered selected expressions by position.
Used the same approach as for #34176 by using selected expressions
position to prevent ambiguous aliases in collisions.

Thanks henribru for the report.

Regression in 04518e310d.
2023-02-20 05:54:25 +01:00
Simon Charette a6511bc233 Refs #33308 -- Added tests for queryset ordered by annotation with nulls_first/nulls_last. 2023-02-18 16:28:10 +01:00
Stefan Brand eacf6b73d8 Fixed #34302 -- Fixed SpatialReference.srid for objects without top-level authority. 2023-02-17 19:56:29 +01:00
Stefan Brand d77762de03 Refs #34302 -- Fixed SpatialReference.auth_name()/auth_code() when target is None.
force_bytes() turns None into the byte string b"None". Since
ctypes.c_char_p() also accepts None, we can bypass force_bytes() if
target is None.
2023-02-17 19:56:29 +01:00
Alexandre Spaeth 52b054824e Fixed #34342, Refs #33735 -- Fixed test client handling of async streaming responses.
Bug in 0bd2c0c901.

Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2023-02-17 10:48:04 +01:00
Alexandre Spaeth bfb8fda3e6 Refs #34342 -- Added tests for handling sync streaming responses by test client.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2023-02-17 10:48:00 +01:00
Nick Pope 8eef22dfed Fixed #34343 -- Moved built-in templates to filesystem. 2023-02-17 09:50:50 +01:00
Durval Carvalho 85366fbca7 Fixed #34045 -- Improved accessibility of selecting items in admin changelist.
This adds "aria-label".
2023-02-16 08:29:40 +01:00
nabil-rady 6bdc3c58b6 Fixed #34320 -- Make sure constraints names are obtained from truncated columns names. 2023-02-15 16:51:31 +01:00
Marcelo Galigniana f9f0092346 Completed test coverage for django.utils.datastructures. 2023-02-15 07:45:00 +01:00
Marcelo Galigniana f608e6a157 Completed test coverage for django.db.migrations.graph. 2023-02-15 07:40:19 +01:00
Marcelo Galigniana 5b23d6666e Completed test coverage for django.forms.utils. 2023-02-15 07:36:05 +01:00
DevilsAutumn ff3a283422 Fixed #34250 -- Fixed renaming model with m2m relation to a model with the same name. 2023-02-14 14:08:06 +01:00
tschilling c5808470aa Fixed #34280 -- Allowed specifying different field values for create operation in QuerySet.update_or_create(). 2023-02-14 11:50:35 +01:00
Markus Holtermann 85ac33591c Fixed CVE-2023-24580 -- Prevented DoS with too many uploaded files.
Thanks to Jakob Ackermann for the report.
2023-02-14 08:18:40 +01:00
sarahboyce e678046681 Fixed #34316 -- Fixed layout of admin password change forms and help texts.
Regression in 96a598356a.
2023-02-13 09:41:31 +01:00
Paolo Melchiorre 69352d85fa
Fixed #33213 -- Doc'd testing code coverage in parallel and used it. 2023-02-11 09:43:26 +01:00
Dhanush a18d20ca97 Fixed #32813 -- Made runserver display port after binding.
Thanks Florian Apolloner for the review.
2023-02-10 08:22:34 +01:00
Jacob Rief 473283d241
Fixed #34303 –- Allowed customizing admin site log entry list.
Added AdminSite.get_log_entries() as an override point and made this
available to the template via each_context().
2023-02-08 18:37:32 +01:00
Mariusz Felisiak 2fd755b361
Fixed #34319 -- Fixed Model.validate_constraints() crash on ValidationError with no code.
Thanks Mateusz Kurowski for the report.

Regression in 667105877e.
2023-02-08 16:38:55 +01:00
Bakdolot 325c44ac6c Fixed #34315 -- Preserved admin changelist filters on "Close" button. 2023-02-08 09:38:14 +01:00
Bernhard M. Wiedemann b4cdcbf239 Removed hardcoded date in SetCookieTests.test_far_expiration().
Follow up to a92c838287.
2023-02-07 20:30:00 +01:00
Nils VAN ZUIJLEN ae1fe72e9b Fixed #34285 -- Fixed index/slice lookups on filtered aggregates with ArrayField.
Thanks Simon Charette for the review.
2023-02-07 13:16:41 +01:00
Jacob Walls 4403432b75 Fixed #33638 -- Fixed GIS lookups crash with geography fields on PostGIS. 2023-02-07 11:48:10 +01:00
Frederic Mheir 2878938626 Fixed #34301 -- Made admin's submit_row check add permission for "Save as new" button. 2023-02-07 07:01:10 +01:00
Mariusz Felisiak 5e9aded33f
Increased the default PBKDF2 iterations for Django 5.0.
Follow up to 9a1848f48c.
2023-02-04 13:37:44 +01:00
Adam Johnson 017fa23d3b Fixed #34259 -- Passed called_from_command_line to command subparsers. 2023-02-03 06:56:57 +01:00
skidipap 1250483ebf Fixed #34286 -- Fixed admindocs markups for case-sensitive template/view names. 2023-02-02 13:21:08 +01:00
David Smith 097e3a70c1 Refs #33476 -- Applied Black's 2023 stable style.
Black 23.1.0 is released which, as the first release of the year,
introduces the 2023 stable style. This incorporates most of last year's
preview style.

https://github.com/psf/black/releases/tag/23.1.0
2023-02-01 11:04:38 +01:00
Nick Pope 8c660fb592 Fixed CVE-2023-23969 -- Prevented DoS with pathological values for Accept-Language.
The parsed values of Accept-Language headers are cached in order to
avoid repetitive parsing. This leads to a potential denial-of-service
vector via excessive memory usage if the raw value of Accept-Language
headers is very large.

Accept-Language headers are now limited to a maximum length in order
to avoid this issue.
2023-02-01 09:44:04 +01:00
sag᠎e 110b3b8356
Fixed #34304 -- Made MySQL's SchemaEditor.remove_constraint() don't create foreign key index when unique constraint is ignored.
Regression in b731e88415.
2023-01-31 11:52:07 +01:00
Stanislav Volyk 20a0850099 Fixed #34283 -- Escaped title in admin's changelist filters.
Regression in 27aa7035f5.
2023-01-30 09:37:53 +01:00
Sarah Boyce 8acc433e41
Fixed #28054 -- Made runserver not return response body for HEAD requests.
Co-authored-by: jannschu <jannik.schuerg@posteo.de>
2023-01-27 21:49:54 +01:00
Raj Desai 246eb4836a Fixed #34254 -- Fixed return value of Exists() with empty queryset.
Thanks Simon Charette for reviews.
2023-01-26 19:54:48 +01:00
Mariusz Felisiak 2b1242abb3
Fixed #34291 -- Fixed Meta.constraints validation crash on UniqueConstraint with ordered expressions.
Thanks Dan F for the report.

Bug in 667105877e.
2023-01-26 09:31:40 +01:00
朱穆穆 d3c93cdc59 Fixed #34227 -- Fixed QuerySet.select_related() with multi-level FilteredRelation. 2023-01-24 10:20:27 +01:00
Matt Westcott ef85b6bf0b Fixed #34192 -- Preserved callable storage when it returns default_storage. 2023-01-23 10:29:17 +01:00
Francesco Panico cc8aa6bf9c Fixed #34267 -- Fixed sliced QuerySet.union() crash.
Regression in 3d734c09ff.

Thanks Raphaël Stefanini for the report.
2023-01-20 08:51:38 +01:00
Niccolò Mineo 79c298c9ce Fixed #34266 -- Added ClosestPoint GIS database functions. 2023-01-20 08:13:43 +01:00
David Wobrock 4b066bde69 Fixed #34272 -- Fixed floatformat crash on zero with trailing zeros to zero decimal places.
Regression in 08c5a78726.

Thanks Andrii Lahuta for the report.
2023-01-19 10:15:40 +01:00
Nick Pope 1e62a64202 Refs #32528 -- Simplified Media.merge().
This avoids building up a second datastructure for the duplicate files
warning case and simply flatten and strip duplicates if that case ever
arises.
2023-01-19 06:33:39 +01:00
Nick Pope 1282b5e420 Fixed #32528 -- Replaced django.utils.topological_sort with graphlib.TopologicalSort().
graphlib.TopologicalSort() is available since Python 3.9.
2023-01-19 06:31:40 +01:00
Mariusz Felisiak 23e8868862
Refs #34233 -- Used str.removeprefix()/removesuffix(). 2023-01-18 19:11:18 +01:00
Nick Pope fd21f82aa8
Refs #34233 -- Used types.NoneType.
Available since Python 3.10 where it was reintroduced.
2023-01-18 17:27:23 +01:00
Nick Pope 26a395f27d
Refs #34233 -- Used aiter() and anext().
Available since Python 3.10.
2023-01-18 13:45:07 +01:00
Mariusz Felisiak b209518089
Refs #32339 -- Deprecated transitional form renderers. 2023-01-18 11:08:39 +01:00
Mariusz Felisiak 3bbe22dafc
Fixed #34233 -- Dropped support for Python 3.8 and 3.9. 2023-01-18 09:46:01 +01:00
Mariusz Felisiak 4fc711a108 Increased the default PBKDF2 iterations for Django 5.0. 2023-01-17 11:49:15 +01:00
Mariusz Felisiak f39f120302 Advanced deprecation warnings for Django 5.0. 2023-01-17 11:49:15 +01:00
Mariusz Felisiak 003081468e Refs #33263 -- Removed warning in BaseDeleteView when delete() method is overridden. 2023-01-17 11:49:15 +01:00
Mariusz Felisiak 94ad46e9d8 Refs #33543 -- Made Expression.asc()/desc() and OrderBy raise ValueError when nulls_first/nulls_last=False is passed.
Per deprecation timeline.
2023-01-17 11:49:15 +01:00
Mariusz Felisiak 98756c685e Refs #32339 -- Changed default form and formset rendering style to div-based.
Per deprecation timeline.

This also removes "django/forms/default.html" and
"django/forms/formsets/default.html" templates.
2023-01-17 11:49:15 +01:00
Mariusz Felisiak b5ac6e78f8 Refs #33691 -- Removed django.contrib.auth.hashers.CryptPasswordHasher per deprecation timeline. 2023-01-17 11:49:15 +01:00
Mariusz Felisiak 71d1203b07 Refs #33348 -- Removed support for passing response object and form/formset name to SimpleTestCase.assertFormError()/assertFormSetError().
Per deprecation timeline.
2023-01-17 11:49:15 +01:00
Mariusz Felisiak d6816bff73 Refs #32365 -- Removed django.utils.timezone.utc per deprecation timeline. 2023-01-17 11:49:15 +01:00
Mariusz Felisiak 9a01311d20 Refs #15619 -- Removed support for logging out via GET requests.
Per deprecation timeline.
2023-01-17 11:49:15 +01:00
Mariusz Felisiak ba082e0952 Refs #33561 -- Made created=True required in signature of RemoteUserBackend.configure_user() subclasses.
Per deprecation timeline.
2023-01-17 11:49:15 +01:00
Mariusz Felisiak 4d78d7338c Refs #31486 -- Removed ability to pass unsaved model instances to related filters.
Per deprecation timeline.
2023-01-17 11:49:15 +01:00
Mariusz Felisiak 1391356276 Refs #29984 -- Made QuerySet.iterator() without chunk_size raise ValueError after prefetch_related().
Per deprecation timeline.
2023-01-17 11:49:15 +01:00
Mariusz Felisiak b119f4329c Refs #29708 -- Removed PickleSerializer per deprecation timeline. 2023-01-17 11:49:15 +01:00
Mariusz Felisiak 23c8787439 Refs #33348 -- Removed support for passing errors=None to SimpleTestCase.assertFormError()/assertFormsetErrors().
Per deprecation timeline.
2023-01-17 11:49:15 +01:00
Mariusz Felisiak 23ec318988 Refs #33342 -- Removed ExclusionConstraint.opclasses per deprecation timeline. 2023-01-17 11:49:15 +01:00
Mariusz Felisiak 5c10041f46 Refs #30127 -- Removed name argument for django.utils.functional.cached_property().
Per deprecation timeline.
2023-01-17 11:49:15 +01:00
Mariusz Felisiak e01970e9d2 Refs #32800 -- Removed CSRF_COOKIE_MASKED transitional setting per deprecation timeline. 2023-01-17 11:49:15 +01:00
Mariusz Felisiak daf88e778b Refs #25916 -- Removed SitemapIndexItem.__str__() per deprecation timeline. 2023-01-17 11:49:15 +01:00
Mariusz Felisiak 31878b4d73 Refs #31026 -- Removed ability to return string when rendering ErrorDict/ErrorList.
Per deprecation timeline.
2023-01-17 11:49:15 +01:00
Mariusz Felisiak 182d25eb7a Refs #31026 -- Removed BaseForm._html_output() per deprecation timeline. 2023-01-17 11:49:15 +01:00
Mariusz Felisiak 4982958ec0 Refs #27674 -- Removed GeoModelAdmin and OSMGeoAdmin per deprecation timeline. 2023-01-17 11:49:15 +01:00
Mariusz Felisiak 2fad163257 Refs #32365 -- Removed is_dst argument for various methods and functions.
Per deprecation timeline.
2023-01-17 11:49:15 +01:00
Mariusz Felisiak e6f82438d4 Refs #32365 -- Removed support for pytz timezones per deprecation timeline. 2023-01-17 11:49:15 +01:00
Mariusz Felisiak 8d98f99a4a Refs #32873 -- Removed settings.USE_L10N per deprecation timeline. 2023-01-17 11:49:15 +01:00
Mariusz Felisiak 0be8095b25 Refs #10929 -- Stopped forcing empty result value by PostgreSQL aggregates.
Per deprecation timeline.
2023-01-17 11:49:15 +01:00
Mariusz Felisiak 43b01300b7 Refs #32655 -- Removed extra_tests argument for DiscoverRunner.build_suite()/run_tests().
Per deprecation timeline.
2023-01-17 11:49:15 +01:00
Mariusz Felisiak 4eb97a90f0 Refs #32375 -- Changed default sitemap protocol to https.
Per deprecation timeline.
2023-01-17 11:49:15 +01:00