Commit Graph

15660 Commits

Author SHA1 Message Date
Mariusz Felisiak cd21b1a228
[2.1.x] Fixed E117 and F405 flake8 warnings.
Backport of 5a5c77d55d from master
2019-01-30 13:10:44 +01:00
Tim Graham 1bb31708a0 [2.1.x] Refs #30097 -- Fixed typos in InlineModelAdmin.has_add_permission() deprecation comments.
Backport of ee9bd8c310 from stable/2.2.x.
2019-01-17 18:41:43 -05:00
MaximZemskov 3df13847d5 [2.1.x] Fixed #30097 -- Made 'obj' arg of InlineModelAdmin.has_add_permission() optional.
Restored backwards compatibility after refs #27991.
Regression in be6ca89396.

Backport of 3c01fe30f3 from master.
2019-01-11 18:03:23 -05:00
Tim Graham bbb87e3da3 [2.1.x] Post-release version bump. 2019-01-04 08:54:01 -05:00
Tim Graham 066f26fe8b [2.1.x] Bumped version for 2.1.5 release. 2019-01-04 08:45:30 -05:00
Tom Hacohen 64d2396e83 [2.1.x] Fixed #30070, CVE-2019-3498 -- Fixed content spoofing possiblity in the default 404 page.
Co-Authored-By: Tim Graham <timograham@gmail.com>
Backport of 1ecc0a395b from master.
2019-01-03 21:22:14 -05:00
Tim Graham 4e4b952123 [2.1.x] Fixed #30050 -- Fixed InlineModelAdmin.has_change_permission() called with non-None obj during add.
Thanks andreage for the report and suggested fix.

Backport of 02c07be95c from master.
2019-01-01 09:53:28 -05:00
Konstantin Alekseev 08f78a4fc8 [2.1.x] Fixed #30015 -- Ensured request body is properly consumed for keep-alive connections.
Backport of b514dc14f4 and
bbe28fa076 from master.
2018-12-20 22:17:21 -05:00
Simon Charette 7cf9d15cf8 [2.1.x] Fixed #30023 -- Prevented SQLite schema alterations while foreign key checks are enabled.
Prior to this change foreign key constraint references could be left pointing
at tables dropped during operations simulating unsupported table alterations
because of an unexpected failure to disable foreign key constraint checks.

SQLite3 does not allow disabling such checks while in a transaction so they
must be disabled beforehand.

Thanks ezaquarii for the report and Carlton and Tim for the review.

Backport of 315357ad25 from master.
2018-12-17 10:01:35 -05:00
Simon Charette fc8c2284e9 [2.1.x] Fixed #29182 -- Fixed schema table alteration on SQLite 3.26+.
SQLite 3.26 repoints foreign key constraints on table renames even when
foreign_keys pragma is off which breaks every operation that requires
a table rebuild to simulate unsupported ALTER TABLE statements.

The newly introduced legacy_alter_table pragma disables this behavior
and restores the previous schema editor assumptions.

Thanks Florian Apolloner, Christoph Trassl, Chris Lamb for the report and
troubleshooting assistance.

Backport of c8ffdbe514 from master.
2018-12-07 14:22:27 -05:00
Tim Graham 1084906927 [2.1.x] Fixed #30013 -- Fixed DatabaseOperations.last_executed_query() with mysqlclient 1.3.14+.
Backport of 284b3221a2 from master.
2018-12-05 15:09:19 -05:00
Carlton Gibson 2a99d476c6 [2.1.x] Post-release version bump. 2018-12-03 18:11:58 +01:00
Carlton Gibson f1374f34da [2.1.x] Bumped version for 2.1.4 release. 2018-12-03 17:37:53 +01:00
Carlton Gibson 27f5b0aff3 [2.1.x] Fixed #29930 -- Allowed editing in admin with view-only inlines.
Co-authored-by: Tim Graham <timograham@gmail.com>
Backport of 8245c99ee6 from master
2018-12-03 17:34:36 +01:00
Basil Dubyk 381bdd4898 [2.1.x] Fixed #29929 -- Fixed admin view-only change form crash when using ModelAdmin.prepopulated_fields.
Backport of 7d1123e5ad from master.
2018-11-28 15:50:30 -05:00
takaaki shimbo 4e6285c490 [2.1.x] Fixed typo in patch_logger() docstring.
Backport of 6275b50ac2 from master
2018-11-25 14:43:44 -05:00
Florian Apolloner e1721ece48 [2.1.x] Fixed #29849 -- Fixed keep-alive support in runserver.
Ticket #25619 changed the default protocol to HTTP/1.1 but did not
properly implement keep-alive. As a "fix" keep-alive was disabled in
ticket #28440 to prevent clients from hanging (they expect the server to
send more data if the connection is not closed and there is no content
length set).

The combination of those two fixes resulted in yet another problem:
HTTP/1.1 by default allows a client to assume that keep-alive is
supported unless the server disables it via 'Connection: close' -- see
RFC2616 8.1.2.1 for details on persistent connection negotiation. Now if
the client receives a response from Django without 'Connection: close'
and immediately sends a new request (on the same tcp connection) before
our server closes the tcp connection, it will error out at some point
because the connection does get closed a few milli seconds later.

This patch fixes the mentioned issues by always sending 'Connection:
close' if we cannot determine a content length. The code is inefficient
in the sense that it does not allow for persistent connections when
chunked responses are used, but that should not really cause any
problems (Django does not generate those) and it only affects the
development server anyways.

Refs #25619, #28440.

Regression in ac756f16c5.
Backport of 934acf1126 from master.
2018-11-20 17:44:03 -05:00
Claude Paroz 0991940c88 [2.1.x] Fixed #29959 -- Cached GEOS version in WKBWriter class.
Regression in f185d929fa.

Backport of e7e5505902 from master.
2018-11-16 15:12:19 -05:00
Mathew Payne 2128c508a2 [2.1.x] Fixed #29952 -- Lowercased all passwords in contrib.auth's auth/common-passwords.txt.gz.
Backport of 26bb2611a5 from master.
2018-11-15 14:11:24 -05:00
minusf 5d0de5852a [2.1.x] Fixed signing.dumps() example for Python 3.
Backport of 545dae24fd from master
2018-11-09 07:27:03 -05:00
Carlton Gibson 78cff67005 [2.1.x] Post-release version bump. 2018-11-01 15:45:51 +01:00
Carlton Gibson d6226e3a82 [2.1.x] Bumped version for 2.1.3 release. 2018-11-01 15:07:09 +01:00
Tim Graham cd7d6c8af7 [2.1.x] Fixed #29890 -- Fixed FileSystemStorage crash if concurrent saves try to create the same directory.
Regression in 632c4ffd9c.

Backport of 98ef3829e9 from master.
2018-10-31 20:24:16 -04:00
Tim Graham 0f02d71995 [2.1.x] Fixed #29896 -- Fixed incorrect Model.save() cache relation clearing for foreign keys that use to_field.
Regression in ee49306176.
Backport of f77fc56c96 from master.
2018-10-28 22:54:19 -04:00
Sergey Fedoseev 69603b3e71 [2.1.x] Fixed #29827 -- Fixed reuse of test databases with --keepdb on MySQL.
Regression in e1253bc26f.
Backport of 9a88c6dd6a from master.
2018-10-25 19:38:00 -04:00
Mariusz Felisiak 81530222c8 [2.1.x] Fixed F841 flake8 warning.
Backport of 641742528a from master.
2018-10-24 09:28:25 -04:00
Adam Allred 0d5d8ed322 [2.1.x] Fixed #29774 -- Fixed django-admin shell hang on startup.
sys.stdin.read() blocks waiting for EOF in shell.py which will
likely never come if the user provides input on stdin via the
keyboard before the shell starts. Added check for a tty to
skip reading stdin if it's not present.

This still allows piping of code into the shell (which should
have no TTY and should have an EOF) but also doesn't cause it
to hang if multi-line input is provided.

Backport of 4e78e389b1 from master.
2018-10-19 20:45:55 -04:00
aspalding 0df7ea1b87 [2.1.x] Fixed #29838 -- Fixed crash when combining Q objects with __in lookups and lists.
Regression in fc6528b25a.

Backport of 834c4ec8e4,
217f82d713, and
dc5e75d419 from master.
2018-10-17 11:40:02 -04:00
Taoufik 6efe2ba057 [2.1.x] Fixed typo in django/utils/datastructures.py.
Backport of f07091a30f from master
2018-10-14 11:20:52 -04:00
Jon Dufresne 6cb5285f29 [2.1.x] Refs #29784 -- Switched to https:// links where available.
Backport of 82f286cf6f from master.
2018-10-09 20:52:43 -04:00
Jon Dufresne ec0803b1be [2.1.x] Capitalized "Python" in docs and comments.
Backport of e90af8bad4 from master.
2018-10-09 20:50:31 -04:00
Carlton Gibson 5045f8af85 Revert "[2.1.x] Refs #27795 -- Removed force_bytes() usage in sessions."
This reverts commit f3f31b0fc2.
2018-10-03 15:14:27 +02:00
Carlton Gibson 54eedddb50 Revert "[2.1.x] Refs #27795 -- Removed force_bytes() usage in MySQL backend."
This reverts commit a47dd99cc6.
2018-10-03 15:14:03 +02:00
Jon Dufresne f3f31b0fc2 [2.1.x] Refs #27795 -- Removed force_bytes() usage in sessions.
SessionBase.decode() is the inverse operation to SessionBase.encode().
As SessionBase.encode() always returns a string, SessionBase.decode()
should always be passed a string argument. Fixed the file backend, which
was the only backend still passing a bytestring.

Backport of bdae19cf63 from master
2018-10-03 11:33:12 +02:00
Jon Dufresne a47dd99cc6 [2.1.x] Refs #27795 -- Removed force_bytes() usage in MySQL backend.
The mysqlclient cursor attribute `_last_executed` is always stored as
bytes. Decode it.

TextField values are already type str. No need to decode.

Backport of efd8a82e26 from master
2018-10-03 10:42:35 +02:00
Carlton Gibson 6da866c047 [2.1.x] Post-release version bump. 2018-10-01 11:40:27 +02:00
Carlton Gibson 38e2fdadfd [2.1.x] Bumped version for 2.1.2 release. 2018-10-01 10:18:50 +02:00
Tim Graham 176d20b92a [2.1.x] Fixed #29809 -- Fixed a crash when a "view only" user POSTs to the admin user change form.
Backport of a7284cc0c3 from master
2018-10-01 10:16:15 +02:00
Carlton Gibson c4bd5b597e Fixed CVE-2018-16984 -- Fixed password hash disclosure to admin "view only" users.
Thanks Claude Paroz & Tim Graham for collaborating on the patch.

# Conflicts:
#	tests/auth_tests/test_views.py
2018-10-01 10:15:50 +02:00
Claude Paroz d5ed08263b [2.1.x] Updated translations from Transifex 2018-09-29 16:03:27 +02:00
Stephen James f5335bc745 [2.1.x] Fixed #29683 -- Added view permission to docs.
Backport of e40e7026ca from master.
2018-09-26 15:06:57 -04:00
Mariusz Felisiak 5aeced6dcd
[2.1.x] Fixed #29630 -- Fixed crash of sliced queries with multiple columns with the same name on Oracle 12.1.
Regression in 0899d583bd.

Thanks Tim Graham for the review and Jani Tiainen for help.
Backport of 024abe5b82 from master
2018-09-26 20:24:20 +02:00
Mariusz Felisiak 1f8a5d4fac [2.1.x] Made DatabaseWrapper.oracle_version() return a full version tuple.
Backport of 90d93a1b42 from master
2018-09-26 08:54:51 +02:00
Oleg cdb8ee741d [2.1.x] Fixed #29778 -- Fixed quoting of unique index names.
Regression in 3b429c9673.
Backport of d1d5c97bc2 from master.
2018-09-25 16:10:47 -04:00
Jon Dufresne f53ed7846b [2.1.x] Refs #29784 -- Normalized Python docs links to omit the version.
Backport of ad9a28ee38 from master.
2018-09-25 10:22:06 +02:00
Mariusz Felisiak 430966c2fc
[2.1.x] Fixed #29759 -- Fixed crash on Oracle when fetching a returned insert id with cx_Oracle 7.
Backport of da92ec7962 from master
2018-09-16 12:49:24 +02:00
Simon Charette 4c5a8c6f50 [2.1.x] Fixed #29755 -- Made migrations detect changes to Meta.default_related_name.
Backport of a4495f4b98 from master
2018-09-14 10:20:27 -04:00
Tim Graham 5bbcf83fce [2.1.x] Fixed #29749 -- Made the migrations loader ignore files starting with a tilde or underscore.
Regression in 29150d5da8.
Backport of 32fbccab40 from master
2018-09-11 12:51:24 -04:00
Alexander Holmbäck bd5ce0599b [2.1.x] Fixed #29727 -- Made nonexistent joins in F() raise FieldError.
Regression in 2162f0983d.

Backport of f315d0423a from master
2018-09-08 09:50:02 -04:00
Carlton Gibson 24a0d1b8a3 [2.1.x] Post-release version bump. 2018-08-31 10:57:02 +02:00