Commit Graph

12905 Commits

Author SHA1 Message Date
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