10505 Commits

Author SHA1 Message Date
Mariusz Felisiak
331324ecce
[3.0.x] Fixed #31790 -- Fixed setting SameSite cookies flag in HttpResponse.delete_cookie().
Cookies with the "SameSite" flag set to None and without the "secure"
flag will be soon rejected by latest browser versions.

This affects sessions and messages cookies.

Backport of 240cbb63bf9965c63d7a3cc9032f91410f414d46 from master.
2020-07-16 09:30:15 +02:00
Ad Timmering
d1ff7c50e3 [3.0.x] Fixed #30807 -- Fixed TestArchive.test_extract_file_permissions() when umask is 0o000.
Fixed test that checks permissions on files extracted from archives
with no permissions set, to not assume a default umask of 0o002.

Test regression in c95d063e776e849cf1a0bf616c654165cb89c706.
Backport of ec5aa2161d8015a3fe57dcbbfe14200cd18f0a16 from master
2020-06-29 07:52:47 +02:00
Simon Charette
453a5bf302 [3.0.x] Fixed #31735 -- Fixed migrations crash on namespaced inline FK addition on PostgreSQL.
The namespace of the constraint must be included when making the
constraint immediate.

Regression in 22ce5d0031bd795ade081394043833e82046016c.

Thanks Rodrigo Estevao for the report.

Backport of 2e8941b6f90e65ffad3f07083b8de59e8ed29767 from master
2020-06-24 09:00:22 +02:00
Mariusz Felisiak
e2cdbc585a
[3.0.x] Refs #31660 -- Fixed annotations.tests crash on MySQL.
Follow up to be7a295141337189b9eceea506489bdfe07f199e.
2020-06-11 10:36:24 +02:00
Nicolas Baccelli
2b2500021b [3.0.x] Fixed #31664 -- Reallowed using non-expressions having filterable attribute as rhs in queryset filters.
Regression in 4edad1ddf6203326e0be4bdb105beecb0fe454c4.

Backport of b38d44229ff185ad156bcb443d6db0db7ae3eb98 from master
2020-06-08 09:20:08 +02:00
Mariusz Felisiak
be7a295141 [3.0.x] Fixed #31660 -- Fixed queryset crash when grouping by m2o relation.
Regression in 3a941230c85b2702a5e1cd97e17251ce21057efa.

Thanks Tomasz Szymański for the report.
Backport of 78ad4b4b0201003792bfdbf1a7781cbc9ee03539 from master
2020-06-08 07:23:33 +02:00
Mariusz Felisiak
e8723af44b [3.0.x] Fixed #31654 -- Fixed cache key validation messages.
Backport of 926148ef019abcac3a9988c78734d9336d69f24e from master
2020-06-05 07:22:52 +02:00
Mariusz Felisiak
88dc69fcec [3.0.x] Refs CVE-2020-13254 -- Fixed cache.tests when KEY_PREFIX is defined.
Follow up to 2c82414914ae6476be5a166be9ff49c24d0d9069.

Backport of 229c9c6653356a0bc23846d83b2d4b5d0438a145 from master
2020-06-03 13:01:21 +02:00
Dan Palmer
84b2da5552 [3.0.x] Fixed CVE-2020-13254 -- Enforced cache key validation in memcached backends. 2020-06-03 09:33:20 +02:00
Jon Dufresne
1f2dd37f6f [3.0.x] Fixed CVE-2020-13596 -- Fixed potential XSS in admin ForeignKeyRawIdWidget. 2020-06-03 09:32:35 +02:00
Carlton Gibson
2638627db4 [3.0.x] Fixed #31570 -- Corrected translation loading for apps providing territorial language variants with different plural equations.
Regression in e3e48b00127c09eafe6439d980a82fc5c591b673.

Thanks to Shai Berger for report, reproduce and suggested fix.

Backport of dd1ca50b096bf0351819aabc862e91a9797ddaca from master
2020-06-01 09:27:53 +02:00
Mariusz Felisiak
0ba5aadb33 [3.0.x] Fixed #31607 -- Fixed evaluated Subquery equality.
Regression in 691def10a0197d83d2d108bd9043b0916d0f09b4.

Backport of a125da6a7c79b1d4c55677d0bed6f9b1d7d77353 from master
2020-05-19 22:51:01 +02:00
Mariusz Felisiak
92acf1022f [3.0.x] Fixed #31584 -- Fixed crash when chaining values()/values_list() after Exists() annotation and aggregation on Oracle.
Oracle requires the EXISTS expression to be wrapped in a CASE WHEN in
the GROUP BY clause.

Regression in efa1908f662c19038a944129c81462485c4a9fe8.
Backport of 3a941230c85b2702a5e1cd97e17251ce21057efa from master
2020-05-14 15:11:18 +02:00
Simon Charette
49bbf6570d [3.0.x] Fixed #31568 -- Fixed alias reference when aggregating over multiple subqueries.
691def10a0197d83d2d108bd9043b0916d0f09b4 made all Subquery() instances
equal to each other which broke aggregation subquery pushdown which
relied on object equality to determine which alias it should select.

Subquery.__eq__() will be fixed in an another commit but
Query.rewrite_cols() should haved used object identity from the start.

Refs #30727, #30188.

Thanks Makina Corpus for the report.

Backport of adfbf653dc1c1d0e0dacc4ed46602d22ba28b004 from master
2020-05-14 10:26:16 +02:00
Simon Charette
afceb2241b [3.0.x] Fixed #31566 -- Fixed aliases crash when chaining values()/values_list() after annotate() with aggregations and subqueries.
Subquery annotation references must be resolved if they are excluded
from the GROUP BY clause by a following .values() call.

Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80.

Thanks Makina Corpus for the report.

Backport of 42c08ee46539ef44f8658ebb1cbefb408e0d03fe from master
2020-05-14 08:40:40 +02:00
Mariusz Felisiak
48ed73fb74 [3.0.x] Fixed E128, E741 flake8 warnings.
Backport of 0668164b4ac93a5be79f5b87fae83c657124d9ab from master.
2020-05-12 08:55:06 +02:00
Adam Johnson
cdf320dfb2 [3.0.x] Fixed a/an typos in "SQL" usage.
Backport of 1c2c6f1b51a540bddc7ae95f4d1213688411ca44 from master
2020-05-06 06:36:16 +02:00
Mariusz Felisiak
fdd5eb4309 [3.0.x] Fixed #31538 -- Fixed Meta.ordering validation lookups that are not transforms.
Regression in 440505cb2cadbe1a5b9fba246bcde6c04f51d07e.

Thanks Simon Meers for the report.
Backport of b73e66e75802f10cc34d4880714554cea54dbf49 from master
2020-05-05 09:09:17 +02:00
Hasan Ramezani
8e23b89ffd [3.0.x] Fixed #31521 -- Skipped test_parsing_rfc850 test on 32-bit systems.
Backport of f12162107327b88a2f1faaab15d048e2535ec642 from master
2020-04-30 07:13:25 +02:00
Hasan Ramezani
22a2e97fc3 [3.0.x] Fixed #31420 -- Fixed crash when filtering subquery annotation against a SimpleLazyObject.
Thanks Simon Charette for the solution and analysis.

Backport of 4237050684427db45ea834fe89d9e11c0520201e from master
2020-04-06 08:15:51 +02:00
Hasan Ramezani
72652bcb1b [3.0.x] Fixed #31377 -- Disabled grouping by aliases on QuerySet.values()/values_list() when they collide with field names.
Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80.

Thanks Holovashchenko Vadym for the report.

Backport of 10866a10fe9f0ad3ffdf6f93823aaf4716e6f27c from master
2020-03-25 09:49:51 +01:00
Claude Paroz
d9f1792c76 [3.0.x] Fixed #30439 -- Added support for different plural forms for a language.
Thanks to Michal Čihař for review.
Backport of e3e48b00127c09eafe6439d980a82fc5c591b673 from master
2020-03-10 15:57:36 +01:00
Mariusz Felisiak
8e30512e7a [3.0.x] Fixed GeoQuerySetTest.test_unionagg_tolerance() test on Oracle 18c.
Backport of 5ca76baa729bbbe62f5c4a0fc4f89747dc999029 from master
2020-03-05 08:56:09 +01:00
Mariusz Felisiak
26a5cf8345 [3.0.x] Fixed CVE-2020-9402 -- Properly escaped tolerance parameter in GIS functions and aggregates on Oracle.
Thanks to Norbert Szetei for the report.
2020-03-04 09:16:03 +01:00
Mariusz Felisiak
c5cfaad2f1 [3.0.x] Fixed #31150 -- Included subqueries that reference related fields in GROUP BY clauses.
Thanks Johannes Hoppe for the report.

Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80.

Co-authored-by: Simon Charette <charette.s@gmail.com>

Backport of 7b8fa1653fde578ab3a496d9974ab1d4261b8b26 from master
2020-03-03 11:26:36 +01:00
Mariusz Felisiak
94e192a580 [3.0.x] Refs #31312 -- Fixed FTimeDeltaTests.test_date_case_subtraction() test.
Follow up to 16cacdcb3f7856df5454b648503374de150fa245.
2020-02-27 20:18:53 +01:00
Simon Charette
16cacdcb3f [3.0.x] Fixed #31312 -- Properly ordered temporal subtraction params on MySQL.
Regression in 9bcbcd599abac91ea853b2fe10b784ba32df043e.

Thanks rick2ricks for the report.

Backport of 41ebe60728a15aa273f4d70de92f5246a89c3d4e from master
2020-02-27 09:20:30 +01:00
Mariusz Felisiak
2448b3182c [3.0.x] Fixed #31271 -- Preserved ordering when unifying query parameters on Oracle.
This caused misplacing parameters in logged SQL queries.

Regression in 79065b55a70cd220820a260a1c54851b7be0615a.

Thanks Hans Aarne Liblik for the report.
Backport of 2a038521c4eabdc5f6d5026d3dd6d22868e329cd from master
2020-02-18 11:46:01 +01:00
Abhijeet Viswa
8faaaf4e71 [3.0.x] Fixed #31246 -- Fixed locking models in QuerySet.select_for_update(of=()) for related fields and parent link fields with multi-table inheritance.
Partly regression in 0107e3d1058f653f66032f7fd3a0bd61e96bf782.

Backport of 1712a76b9dfda1ef220395e62ea87079da8c9f6c from master
2020-02-11 21:36:05 +01:00
Florian Apolloner
4e8d6a1baf [3.0.x] Fixed #31240 -- Properly closed FileResponse when wsgi.file_wrapper is used.
Thanks to Oskar Persson for the report.

Backport of 41a3b3d18647b258331104520e76f977406c590d from master
2020-02-11 20:40:24 +01:00
Florian Apolloner
22c25bea54 [3.0.x] Reverted "Fixed #30565 -- Closed HttpResponse when wsgi.file_wrapper closes file-like object."
This reverts commit cce47ff65a4dd3786c049ec14ee889e128ca7de9.

Backport of 549445519ce90cc5c1e3f981853cc0c67725f3ed from master
2020-02-11 20:40:17 +01:00
Jon Dufresne
7540b7eb31 [3.0.x] Fixed #31253 -- Fixed data loss possibility when using caching from async code.
Case missed in a415ce70bef6d91036b00dd2c8544aed7aeeaaed.

Backport of e3f6e18513224c8ad081e5a19da641f49b0b43da from master
2020-02-11 10:12:53 +01:00
Simon Charette
505826b469 [3.0.x] Fixed CVE-2020-7471 -- Properly escaped StringAgg(delimiter) parameter. 2020-02-03 08:32:54 +01:00
Mariusz Felisiak
673444da5e [3.0.x] Fixed #31217 -- Made QuerySet.values()/values_list() group by not selected annotations with aggregations used in order_by().
Regression in 59b4e99dd00b9c36d56055b889f96885995e4240.

Thanks Jon Dufresne for the report and Simon Charette for the review.
Backport of 6b178a3e930f72069f3cda2e6a09d1b320fc09ec from master
2020-02-03 07:48:53 +01:00
Eugene Hatsko
a56e45a2bf [3.0.x] Fixed #31190 -- Fixed prefetch_related() crash for GenericForeignKey with custom ContentType foreign key.
Regression in dffa3e1992562ba60512d96d1eb5859ffff2ceb5.

Backport of 0b013564ef0609d95b1d263626f2e15bccda1a50 from master
2020-01-22 08:25:23 +01:00
Sergey Fedoseev
d7e4d6463c [3.0.x] Fixed #31195 -- Relaxed GeometryDistance test for PROJ 5.2+.
Backport of 31e2ab345b272b309770262067710589ec433e79 from master
2020-01-21 22:51:45 +01:00
Mariusz Felisiak
5b6778b8b9 [3.0.x] Refs #31097 -- Added django.db.models.Q import to contrib.postgres aggregates tests. 2020-01-17 09:13:11 +01:00
Carlton Gibson
57468eaff3 [3.0.x] Fixed #31124 -- Fixed setting of get_FOO_display() when overriding inherited choices.
Regression in 2d38eb0ab9f78d68c083a5b78b1eca39027b279a

Backport of 29c126bb349526b5f1cd78facbe9f25906f18563 from master
2020-01-15 15:36:28 +01:00
Mariusz Felisiak
a24686987f [3.0.x] Refs #31136 -- Made QuerySet.values()/values_list() group only by selected annotation.
Regression in 0f843fdd5b9b2f2307148465cd60f4e1b2befbb4.
Backport of 59b4e99dd00b9c36d56055b889f96885995e4240 from master
2020-01-15 09:33:36 +01:00
David Wobrock
0e6cf4393c [3.0.x] Fixed #31097 -- Fixed crash of ArrayAgg and StringAgg with filter when used in Subquery.
Backport of 2f565f84aca136d9cc4e4d061f3196ddf9358ab8 from master
2020-01-14 09:49:56 +01:00
Mariusz Felisiak
92866682c6 [3.0.x] Fixed #31155 -- Fixed a system check for the longest choice when a named group contains only non-string values.
Regression in b6251956b69512bf230322bd7a49b629ca8455c6.

Thanks Murat Guchetl for the report.
Backport of 6f7998adc784032f4b8918ca2eea27537ea4cbbe from master
2020-01-11 19:49:38 +01:00
Adam Johnson
16297e7d5e [3.0.x] Fixed #31154 -- Added support for using enumeration types in templates.
Enumeration helpers are callables, so the template system tried to call
them with no arguments.

Thanks Rupert Baker for helping discover this.

Backport of 5166097d7c80cab757e44f2d02f3d148fbbc2ff6 from master
2020-01-10 09:13:36 +01:00
Mariusz Felisiak
0379da59bd [3.0.x] Fixed #31141 -- Relaxed system check of translation settings for sublanguages.
Regression in 4400d8296d268f5a8523cd02ddc33b12219b2535.

Thanks Enrique Matías Sánchez for the report.
Backport of 53d8646f799de7f92ab9defe9dc56c6125448102 from master
2020-01-08 08:06:33 +01:00
Mariusz Felisiak
f9110a1b6d [3.0.x] Fixed timezones tests for PyYAML 5.3+.
Backport of 8be477be5c1a4afc9ad00bb58a324f637e018c0f from master
2020-01-07 09:55:15 +01:00
Mariusz Felisiak
4f81f6d236 [3.0.x] Fixed #31136 -- Disabled grouping by aliases on QuerySet.values()/values_list().
Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80.

Thanks Sigurd Ljødal for the report.
Backport of 0f843fdd5b9b2f2307148465cd60f4e1b2befbb4 from master
2020-01-04 20:49:43 +01:00
Simon Charette
02cda09b13 [3.0.x] Fixed #31133 -- Fixed crash when subtracting against a subquery annotation.
The subtract_temporals() database operation was not handling expressions
returning SQL params in mixed database types.

Regression in 35431298226165986ad07e91f9d3aca721ff38ec.

Thanks Reupen Shah for the report.

Backport of 9bcbcd599abac91ea853b2fe10b784ba32df043e from master
2020-01-03 10:35:44 +01:00
Mariusz Felisiak
09b4224e11 [3.0.x] Refs #31040 -- Fixed crypt.crypt() call in test_hashers.py.
An empty string is invalid salt in Python 3 and raises exception since
Python 3.9, see https://bugs.python.org/issue38402.
Backport of 1960d55f8baa412b43546d15a8342554808fff57 from master
2020-01-03 07:47:56 +01:00
Simon Charette
7db4ab8439 [3.0.x] Fixed #31071 -- Disabled insert optimization for primary keys with defaults when loading fixtures.
Model.save_base() is called directly when loading fixtures and assumes
existing rows will be updated. Branching of "raw" allows to maintain
the optimization introduced in #29260 while supporting this edge case.

Regression in 85458e94e38c20e57939947ee515a1a53689659f.

Thanks Reupen Shah for the report.

Backport of 5779cc938a34eb96815c7a40ded2c8f6c8087c58 from master
2019-12-30 08:30:44 +01:00
Mariusz Felisiak
0f8041abd5 [3.0.x] Fixed #31106 -- Fixed migrations crash on PostgreSQL 10+ when adding FK constraints inline and changing data.
This allows adding foreign key constraints inline and changing data in
the same migration on PostgreSQL 10+.

Regression in 738faf9da2a5cd03148a36375db80746c99c9623.

Thanks Janne Rönkkö for the report and Simon Charette for the
implementation idea and review.
Backport of 22ce5d0031bd795ade081394043833e82046016c from master
2019-12-23 23:30:30 +01:00
Mariusz Felisiak
1e45b06cfd [3.0.x] Refs #31115 -- Added test for nested subquery that references related fields.
Thanks Dmitriy Gunchenko for the report and Simon Charette for the
analysis and tests.

Regression in 5a4d7285bd10bd40d9f7e574a7c421eb21094858.

Fixed in 5a4d7285bd10bd40d9f7e574a7c421eb21094858.
Backport of 45bcc6feac68165eb3642d3c308c74b4828e679e from master
2019-12-23 12:18:52 +01:00