1
0
mirror of https://github.com/django/django.git synced 2025-04-07 23:16:46 +00:00

10440 Commits

Author SHA1 Message Date
Mariusz Felisiak
b6be0699b9 [3.0.x] Fixed #30986 -- Fixed queryset crash when filtering against boolean RawSQL expressions on Oracle.
Backport of 8685e764efd2957085762d9249e07794d9a58dcb from master
2019-11-18 09:16:21 +01:00
George Marshall
fa6076daf4 [3.0.x] Fixed #30971 -- Prevented Query.resolve_lookup_value() from coercing list values to tuples.
Regression in 8a281aa7fe76a9da2284f943964a9413697cff1f.

Backport of 8be79984dce7d819879a6e594ca69c5f95a08378 from master
2019-11-13 09:20:50 +01:00
Hannes Ljungberg
8d3f43f7a9 [3.0.x] Fixed #30967 -- Fixed TrigramTest failures on PostgreSQL 12+.
Backport of 6e2f05b2e33a6c80c7a411ce76af7b5a08acb835 from master
2019-11-11 13:30:14 +01:00
Stephen Rauch
76d293f3e6 [3.0.x] Refs #30183 -- Doc'd dropping support for sqlparse < 0.2.2.
Support for sqlparse < 0.2.2 was broken in
782d85b6dfa191e67c0f1d572641d8236c79174c because is_whitespace property
was added in sqlparse 0.2.2.

Backport of 4b6db766ba4b613d317c87f87d1d63865b7424a4 from master
2019-11-06 09:01:48 +01:00
Carlton Gibson
dd2ca8b0ea [3.0.x] Fixed #30931 -- Restored ability to override Model.get_FIELD_display().
Thanks Sergey Fedoseev for the implementation idea.

Regression in a68ea231012434b522ce45c513d84add516afa60.

Backport of 2d38eb0ab9f78d68c083a5b78b1eca39027b279a from master
2019-11-04 08:15:03 +01:00
Carlton Gibson
8740ff334a [3.0.x] Fixed #30902 -- Added __str__() for model choice enums.
Allows expected behavior when cast to str, also matching behaviour of
created instances with those fetched from the DB.

Thanks to Simon Charette, Nick Pope, and Shai Berger for reviews.

Backport of dbcd7b064e7278614f29fc45468d461e263d4da7 from master
2019-10-25 09:38:41 +02:00
Carlton Gibson
06e3c6db86 [3.0.x] Fixed #30900 -- Skipped async-related tests on Windows using Python 3.8.0.
Refs https://bugs.python.org/issue38563.
Backport of e83c300a3312995d46315616f4361dfa110c741b from master
2019-10-24 10:43:37 +02:00
Hannes Ljungberg
318d186d7e [3.0.x] Fixed #30903 -- Fixed migrations crash on PostgreSQL when adding Index with opclasses and ordering.
Backport of fa5f3291e7f2611d53e64ab481ebe951b0161791 from master
2019-10-24 09:51:33 +02:00
Mariusz Felisiak
517d31516a [3.0.x] Refs #29926 -- Bumped minimum tblib version to 1.5.0 in test requirements.
Backport of 25903e41fb45ce9cc80dc93bf4b51ea431dcb2b6 from master
2019-10-23 15:26:54 +02:00
Mariusz Felisiak
753a34b42a [3.0.x] Refs #29926 -- Skipped RemoteTestResultTest.test_add_failing_subtests() on Python 3.8+ and tblib <= 1.4.0.
Backport of 2847d2c760438195c4c71ea9d3fded1ce116ea4e from master
2019-10-22 15:34:44 +02:00
Mariusz Felisiak
74c5ddc657 [3.0.x] Refs #27910 -- Added __init__.py file for model_enums tests.
Backport of 1877ec18753947795b7821f8b9176bd7ea7c03a3 from master
2019-10-15 21:28:17 +02:00
Mariusz Felisiak
4a756cbc38 [3.0.x] Fixed #30870 -- Fixed showing that RunPython operations are irreversible by migrate --plan.
Thanks Hasan Ramezani for the initial patch and Kyle Dickerson for the
report.

Backport of 06d34aab7cfb1632a1538a243db81f24498525ff from master
2019-10-14 11:43:15 +02:00
Mariusz Felisiak
4a263af64e [3.0.x] Isolated migrations.test_commands.MigrateTests.test_migrate_plan.
Backport of 05186c03a30686f4898c1cb9acf4b8613035afcc from master
2019-10-14 11:43:06 +02:00
Simon Charette
bab3ad54ff [3.0.x] Fixed #30868 -- Prevented unnecessary AlterField when renaming a referenced pk.
Regression introduced by dcdd219ee1, refs #25817.

Thanks Carlos E. C. Leite for the report and Mariusz for the bisect.

Backport of 2839659b42ef80038152768b6cedae1016c59d90 from master
2019-10-14 08:27:36 +02:00
Etienne Chové
651299e1ef [3.0.x] Fixed #30014 -- Fixed ModelChoiceField validation when initial value is a model instance.
Thanks Carlton Gibson for reviews.

Backport of e7cdb0cd7eb5eb677af8dae7bfc6845186f861b0 from master
2019-10-11 14:33:32 +02:00
Etienne Chové
82ba905db3 [3.0.x] Added ModelChoiceField test for validation with to_field_name.
Backport of a12f9cd95a24573612daaf844ec97d4aed12446d from master
2019-10-11 14:33:16 +02:00
Louise Grandjonc
cf7ef5d258 [3.0.x] Fixed #30826 -- Fixed crash of many JSONField lookups when one hand side is key transform.
Regression in 6c3dfba89215fc56fc27ef61829a6fff88be4abb.

Backport of 7d1bf29977bb368d7c28e7c6eb146db3b3009ae7 from master
2019-10-11 11:51:14 +02:00
Hasan Ramezani
c1cfec6b50 [3.0.x] Fixed #30854 -- Fixed QuerySet.select_related() with multiple FilteredRelations.
Backport of 6a75cea76a98c08bf2e20d787be9b14c2cd94860 from master.
2019-10-11 09:18:23 +02:00
Hasan Ramezani
7c70aa8f63 [3.0.x] Fixed #30839 -- Fixed Field.__deepcopy__() so forms don't share error messages.
Backport of a28d1b38e55cf588cfaae97de6a575d5c9f90a96 from master
2019-10-08 10:28:30 +02:00
Hasan Ramezani
30271a47da [3.0.x] Refs #27914 -- Fixed serialization of nested enum.Enum classes in migrations.
Backport of 6452112640081ac8838147a8ba192c45879203d8 from master
2019-10-03 11:17:10 +02:00
Hasan Ramezani
1a4db2cc28 [3.0.x] Refs #27914 -- Moved test enum.Enum subclasses outside of WriterTests.test_serialize_enums().
Backport of d3030deaaa50b7814e34ef1e71f2afaf97c6bec6 from master
2019-10-03 11:17:04 +02:00
Ahmet Kucuk
9dc13f41b5 [3.0.x] Fixed #30510 -- Fixed crash of QuerySet.bulk_create() with mixed-length texts on Oracle.
Text with more than 4000 characters must be set to as a CLOB on Oracle
what caused a mixed datatype error (ORA-01790) when shorter text
appeared in the same operation.

Backport of dc890bef5ad8e9fccce55f3e64af72103ea6e8c1 from master
2019-10-01 13:11:19 +02:00
Ad Timmering
556d0c08bd [3.0.x] Fixed #28690 -- Fixed handling of two-digit years in parse_http_date().
Due to RFC7231 ayear that appears to be more than 50 years in the
future are interpreted as representing the past.

Backport of 7b5f8acb9e6395a1660dd7bfeb365866ca8ef47c from master
2019-09-30 15:39:36 +02:00
Ad Timmering
f38655ed1c [3.0.x] Refs #28690 -- Added more tests for parse_http_date().
Backport of 7cbd25a06e820cbd1a0bfbc339fb7d9a737c54fa from master
2019-09-30 15:39:28 +02:00
Hasan Ramezani
df0c2ac358 [3.0.x] Fixed #30774 -- Made serialization in migrations use members names for Enums.
Backport of f0adf3b9b7a19cdee05368ff0c0c2d087f011180 from master
2019-09-30 10:52:30 +02:00
pablo
5d63bf0bc3 [3.0.x] Fixed #30802 -- Prevented manifest creation when running collectstatic in dry run mode.
Backport of fa8fe09e4e2b538c5d50a559081861d5c0635d55 from master
2019-09-27 23:06:55 +02:00
Hasan Ramezani
0dc39ca867 [3.0.x] Fixed #30798 -- Fixed Meta.ordering validation for pk of related fields.
Regression in 440505cb2cadbe1a5b9fba246bcde6c04f51d07e.

Backport of 95a11578ce41de1e152fe7d173f109e280aebd6d from master
2019-09-27 14:52:08 +02:00
Hasan Ramezani
da8f85aa82 [3.0.x] Refs #30798 -- Prevented chaining fields from the same related model multiple times in model Meta.ordering.
Backport of c7944628a1979453468d67818c63957532d396d8 from master
2019-09-27 14:52:02 +02:00
Pablo García
49dcb5d3ba [3.0.x] Fixed #30810 -- Fixed WatchmanReloaderTests.test_setting_timeout_from_environment_variable test.
client_timeout is an instance attribute.

Backport of 2fd610eb301dc01e100befed891e8007fd2e981f from master
2019-09-27 08:35:55 +02:00
Mariusz Felisiak
1adf85d168 [3.0.x] Fixed #30800 -- Fixed migrations crash when altering a field with custom db_type().
Regression in 1378d665a1c85897d951f2ca9618b848fdbba2e7.
Backport of 580e644f24f1c5ae5b94784fb73a9953a178fd26 from master
2019-09-25 12:32:57 +02:00
Simon Charette
6b7bd079a6 [3.0.x] Fixed #30796 -- Prevented select_related() from mutating a queryset on chaining.
Thanks Darren Maki for the report.

Backport of 37f8f293775d0b672da8ae369d9a4e17f1db7851 from master
2019-09-24 09:47:21 +02:00
Hasan Ramezani
2362f27265 [3.0.x] Fixed #13296 -- Fixed ordering by Options.order_with_respect_to after deleting objects.
Thanks Simon Meers for the original patch.

Backport of f97bbad908df128189eff77d98af9a25ed1ecf23 from master
2019-09-23 11:45:33 +02:00
Mariusz Felisiak
1611906094
[3.0.x] Refs #30771 -- Fixed RemovedInDjango31Warning in test_exact_query_rhs_with_selected_columns. 2019-09-20 22:01:28 +02:00
James Timmins
3697ddbf75 [3.0.x] Fixed #30771 -- Fixed exact lookup against queries with selected columns.
Use pre-existing select fields (and thereby GROUP BY fields) from
subquery if they were specified, instead of always defaulting to pk.

Thanks Aur Saraf for the report and Simon Charette for guidance.

Backport of 0719edcd5fed56157ffb3323a8f634aa5e8f9a80 from master
2019-09-20 11:14:39 +02:00
Sam Reynolds
e74ca0226a [3.0.x] Fixed #30776 -- Restored max length validation on AuthenticationForm.UsernameField.
Regression in 5ceaf14686ce626404afb6a5fbd3d8286410bf13.

Thanks gopackgo90 for the report and Mariusz Felisiak for tests.

Backport of 6c9778a58e4f680db180d4cc9dc5639d2ec1b40c from master
2019-09-18 12:04:47 +02:00
Nasir Hussain
685d956764 [3.0.x] Fixed #30758 -- Made RangeFields use multiple hidden inputs for initial data.
Backport of faf4b988fe75dd4045bc5c62496cc4f2e0db8c4d from master.
2019-09-17 12:21:02 +02:00
Simon Charette
574154ef56 [3.0.x] Fixed #30769 -- Fixed a crash when filtering against a subquery JSON/HStoreField annotation.
This was a regression introduced by 7deeabc7c7526786df6894429ce89a9c4b614086
to address CVE-2019-14234.

Thanks Tim Kleinschmidt for the report and Mariusz for the tests.

Backport of 6c3dfba89215fc56fc27ef61829a6fff88be4abb from master
2019-09-16 08:53:02 +02:00
Mariusz Felisiak
8ce932a20a [3.0.x] Refs #30591 -- Fixed too long identifier crash in migrations.test_operations on MySQL 8.0.16+.
Backport of 937ddaff55efbfb4a9560603bbc8c5b17d9e1364 from master
2019-09-11 12:20:51 +02:00
Adnan Umer
acb11725f8 [3.0.x] Fixed #30591 -- Fixed recreation of foreign key constraints on MySQL when altering type of referenced unique field.
Thanks Mariusz Felisiak for tests and Matthijs Kooijman for
investigation and initial patch.

Backport of 241deed2590bcb1d8c45271d44c86eaedfb57119 from master
2019-09-11 11:43:55 +02:00
Simon Charette
34decdebf1 Fixed #30754 -- Prevented inclusion of aliases in partial index conditions.
SQLite doesn't repoint table aliases in partial index conditions on table
rename which breaks the documented table alteration procedure.

Thanks Pēteris Caune for the report.
2019-09-10 10:03:16 +02:00
Vojtech Bocek
b1d37fea8f Fixed #28107 -- Added DatabaseFeatures.allows_group_by_selected_pks_on_model() to allow enabling optimization for unmanaged models. 2019-09-09 14:04:46 +02:00
Nick Pope
406dba04e1 Fixed #29406 -- Added support for Referrer-Policy header.
Thanks to James Bennett for the initial implementation.
2019-09-09 13:35:41 +02:00
Johannes Hoppe
7254f1138d Refs #29444 -- Allowed returning multiple fields from INSERT statements on PostgreSQL.
Thanks Florian Apolloner, Tim Graham, Simon Charette, Nick Pope, and
Mariusz Felisiak for reviews.
2019-09-09 10:51:14 +02:00
Nick Pope
b6251956b6 Fixed #30757 -- Added a system check to ensure max_length fits the longest choice. 2019-09-09 10:28:18 +02:00
Claude Paroz
05d0eca635 Fixed #30426 -- Changed X_FRAME_OPTIONS setting default to DENY. 2019-09-09 08:15:26 +02:00
Hasan Ramezani
6c379f1a18 Fixed #30763 -- Fixed management commands when using required mutually exclusive groups. 2019-09-06 10:55:24 +02:00
Hasan Ramezani
b93d786251 Made SchemaTests.test_alter_db_table_case run only on backends where table names are case-insensitive. 2019-09-05 08:59:48 +02:00
Shai Berger
72ebe85a26 Fixed #27910 -- Added enumeration helpers for use in Field.choices.
These classes can serve as a base class for user enums, supporting
translatable human-readable names, or names automatically inferred
from the enum member name.

Additional properties make it easy to access the list of names, values
and display labels.

Thanks to the following for ideas and reviews:

Carlton Gibson, Fran Hrženjak, Ian Foote, Mariusz Felisiak, Shai Berger.

Co-authored-by: Shai Berger <shai@platonix.com>
Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2019-09-04 14:42:49 +02:00
Nasir Hussain
25706d7285 Fixed #29714 -- Allowed using ExceptionReporter subclass with AdminEmailHandler. 2019-09-04 08:40:46 +02:00
Viktor Lomakin
5931d2e96a Fixed #30691 -- Made migrations autodetector find dependencies for foreign keys altering. 2019-09-03 14:45:49 +02:00