Commit Graph

27062 Commits

Author SHA1 Message Date
Mariusz Felisiak a9179ab032
Fixed typo in BasicExpressionsTests.test_object_update_fk() test. 2019-06-21 12:00:42 +02:00
Jon Dufresne 2ef6f209f7 Fixed typos in 1.11.19, 2.0.11, 2.1.6 release notes. 2019-06-21 07:07:23 +02:00
Tobias Kunze a387ef1117 Added missing form argument in modelform_factory() docstring. 2019-06-20 15:13:22 +02:00
Mariusz Felisiak 9aeac29949
Removed unnecessary backslashes from docs. 2019-06-20 14:04:36 +02:00
Mariusz Felisiak 7f19e37135 Refs #30451 -- Added more tests for ASGIRequest and ASGIHandler. 2019-06-20 12:29:58 +02:00
Andrew Godwin a415ce70be Fixed #30451 -- Added ASGI handler and coroutine-safety.
This adds an ASGI handler, asgi.py file for the default project layout,
a few async utilities and adds async-safety to many parts of Django.
2019-06-20 12:29:43 +02:00
Chris Jerdonek cce47ff65a Fixed #30565 -- Closed HttpResponse when wsgi.file_wrapper closes file-like object. 2019-06-20 11:48:49 +02:00
Chris Jerdonek 533311782f Refs #30565 -- Doc'd HttpResponse.close() method. 2019-06-20 11:48:49 +02:00
Swat009 00169bc361 Fixed #30547 -- Doc'd how Meta.constraints affect model validation. 2019-06-20 10:44:02 +02:00
Jon Dufresne b903bb438f Refs #30485 -- Removed non-representative test that emitted a warning.
Previously, when running the Django test suite with warnings enabled,
the following was emitted:

    /usr/lib64/python3.7/urllib/parse.py:915: BytesWarning: str() on a bytearray instance
      v = quote_via(str(v), safe, encoding, errors)

This occurred due to the bytearray() being passed to
urllib.parse.urlencode() which eventually calls str() on it. The test
does not represent desired real world behavior. Rather than test for and
assert strange unspecified behavior that emits a warning, remove it.

This was also discussed in PR #11374.
2019-06-19 13:03:52 +02:00
can 2cbd3967e0 Fixed #29834 -- Fixed column mismatch crash with QuerySet.values()/values_list() and order_by() on combined querysets. 2019-06-19 12:11:28 +02:00
Mariusz Felisiak 14d026cccb
Fixed #30572 -- Prevented values()/values_list() on combined queryset from mutating the list of columns in querysets. 2019-06-19 10:44:53 +02:00
Hasan Ramezani a7038adbd0 Fixed typos in signals and custom management commands docs. 2019-06-19 08:40:46 +02:00
Hasan Ramezani 036362e0cf Fixed typos and example in signals.pre_init docs. 2019-06-18 14:51:17 +02:00
Mariusz Felisiak b08a18f17b
Fixed LiveWidgetTests.test_textarea_trailing_newlines() crash on Chrome 75+. 2019-06-18 11:38:51 +02:00
Min ho Kim 6e8303d49b Fixed typos in FakePayload docstring and SimplifiedURLTests test name. 2019-06-17 12:38:04 +02:00
Mariusz Felisiak 415e899dc4 Refs #30451 -- Added HttpRequest._set_content_type_params() hook. 2019-06-15 10:29:02 -07:00
Sanyam Khurana 87f5d07eed Fixed #12952 -- Adjusted admin log change messages to use form labels instead of field names. 2019-06-14 18:20:29 +02:00
Carlton Gibson 1564e42ad3 Refs #30512, #15042 -- Added local-only address to sanitize_email() tests cases.
email.headerregistry.parser.get_mailbox() returns a token with a `token_type` attribute.

If `token_type` is `’invalid-mailbox’` then RFC violations have been detected. Emails with only the local part, and no domain,  are correctly parsed but are marked as `’invalid-mailbox’`.

As per #15042, local-only are supported, to enable sending to addresses on localhost.

sanitize_email() does not currently check `token_type`. This test is added to avoid a regression in case this is revisited in the future.
2019-06-13 17:29:58 +02:00
Joachim Jablon 2628ea9515 Fixed #30512 -- Used email.headerregistry.parser for parsing emails in sanitize_address(). 2019-06-13 16:22:15 +02:00
Joachim Jablon 0c2ffdd526 Fixed an example of email with display name in EmailMessage.from_email. 2019-06-13 16:22:15 +02:00
Mariusz Felisiak fc2536fe66
Refs #29548 -- Doc'd MariaDB support for GIS database functions. 2019-06-13 10:26:21 +02:00
can fde9b7d35e Fixed #30128 -- Fixed handling timedelta timezone in database functions. 2019-06-13 09:29:43 +02:00
Mariusz Felisiak 3dca8738cb
Simplified GISFunctionsTests.test_point_on_surface(). 2019-06-12 12:59:02 +02:00
Sergey Fedoseev 6fa71872ae Simplified django.urls.reverse() a bit. 2019-06-12 12:15:40 +02:00
Mariusz Felisiak b616f65855
Added missing support for PointOnSurface function on MariaDB. 2019-06-12 10:51:43 +02:00
Mariusz Felisiak 198a0adef2 Removed obsolete comment from GISFunctionsTests.test_asgeojson(). 2019-06-12 09:43:03 +02:00
Mariusz Felisiak 2e00119e39 Fixed GISFunctionsTests.test_asgeojson() crash on MariaDB 10.2+. 2019-06-12 09:43:03 +02:00
Jon Dufresne 9e38ed0536 Fixed #27486 -- Fixed Python 3.7 DeprecationWarning in intword and filesizeformat filters.
intword and filesizeformat passed floats to ngettext() which is
deprecated in Python 3.7. The rationale for this warning is documented
in BPO-28692: https://bugs.python.org/issue28692.

For filesizeformat, the filesize value is expected to be an int -- it
fills %d string formatting placeholders. It was likely coerced to a
float to ensure floating point division on Python 2. Python 3 always
does floating point division, so coerce to an int instead of a float to
fix the warning.

For intword, the number may contain a decimal component. In English, a
decimal component makes the noun plural. A helper function,
round_away_from_one(), was added to convert the float to an integer that
is appropriate for ngettext().
2019-06-11 20:34:59 +02:00
Jon Dufresne 175656e166 Fixed intword example in docs/ref/contrib/humanize.txt. 2019-06-11 20:18:36 +02:00
Jon Dufresne 53ea535f13 Refs #27486 -- Added tests for filesizeformat filter. 2019-06-11 20:18:36 +02:00
Vyacheslav Ver 76b3fc5c8d Fixed #30486 -- Fixed the default value of Aggregate.distinct and updated example of custom aggregate functions. 2019-06-11 11:40:48 +02:00
Mykola Nicholas f3a03d5b61 Changed charset and collation link to MySQL docs. 2019-06-11 11:16:27 +02:00
CruxBox 34f8eeea4a Fixed #30548 -- Improved exception when expression contains mixed types. 2019-06-10 19:48:53 +02:00
swatantra 03cd3d137e Fixed #30553 -- Clarified the default value of disable_existing_loggers. 2019-06-10 13:38:49 +02:00
Aymeric Augustin 3ee0834a46 Fixed #30556 -- Avoided useless query and hasher call in ModelBackend.authenticate() when credentials aren't provided.
There's no need to fetch a user instance from the database unless
a username and a password are provided as credentials.
2019-06-10 11:12:31 +02:00
Jon Dufresne e065b29387 Refs #27804 -- Used subTest() in filesizeformat tests and HumanizeTests. 2019-06-10 08:46:11 +02:00
Hasan Ramezani dcb8f00d06 Fixed #29379 -- Added autocomplete attribute to contrib.auth.forms fields.
Thank you to Nick Pope for review.

Co-authored-by: CHI Cheng <cloudream@gmail.com>
2019-06-07 12:44:39 +02:00
Alexandre Varas c498f088c5 Fixed #30521 -- Fixed invalid HTML in default error pages. 2019-06-07 07:51:45 +02:00
Mariusz Felisiak 3fb0a1a67f Refs #30521 -- Added tests for content of default error pages. 2019-06-07 07:49:17 +02:00
Jon Dufresne d6ea4898c4 Fixed #30550 -- Fixed decoding of non-UTF-8 bytes objects in response.json(). 2019-06-07 06:40:15 +02:00
Jon Dufresne 498092377b Refs #27804 -- Used subTest() in BinaryFieldTests.test_set_and_retrieve. 2019-06-07 06:04:56 +02:00
Joachim Jablon 8ba20d9071 Refs #30512 -- Added tests for sanitizing email addresses with display name and two @ signs. 2019-06-06 15:05:56 +02:00
Joachim Jablon f841a776fe Refs #30512 -- Used subTest() in MailTests.test_sanitize_address. 2019-06-06 14:50:40 +02:00
Hasan Ramezani 661e6cc2c9 Fixed #29706 -- Made RenameContentType._rename() save to the correct database. 2019-06-06 12:09:01 +02:00
Arpana Mehta 4b45b6c8e4 Updated Hindi language name. 2019-06-06 11:16:19 +02:00
Tobias Bengfort 581a0f4545 Refs #30226 -- Added User.get_user_permissions() method.
Added to mirror the existing User.get_group_permissions().
2019-06-05 13:56:37 +02:00
Tobias Bengfort 75337a6050 Fixed #30226 -- Added BaseBackend for authentication. 2019-06-05 13:39:46 +02:00
Étienne Beaulé 4b6dfe1622 Fixed #30542 -- Fixed crash of numerical aggregations with filter.
Filters in annotations crashed when used with numerical-type
aggregations (i.e. Avg, StdDev, and Variance). This was caused as the
source expressions no not necessarily have an output_field (such as the
filter field), which lead to an AttributeError: 'WhereNode' object has
no attribute output_field.

Thanks to Chuan-Zheng Lee for the report.

Regression in c690afb873 and two following
commits.
2019-06-05 08:06:26 +02:00
Mariusz Felisiak 1f81e2df69 Added stub release notes for 2.2.3. 2019-06-05 06:57:44 +02:00