Commit Graph

27223 Commits

Author SHA1 Message Date
can 325d5d6445 Fixed #30477 -- Made reverse lookup use Field.get_db_prep_value() from the target field. 2019-06-25 10:20:33 +02:00
daniel a rios 76b993a117 Fixed #26431 -- Prevented django.urls.resolve() from returning missing optional parameters.
Previous behavior was inconsistent with django.urls.reverse() and
caused that translate_url() created an incorrect URL when an optional
parameter was missing.
2019-06-24 11:47:56 +02:00
daniel a rios d640c71fa3 Refs #26431 -- Added tests for resolving URL and translate_url() with provided optional parameter. 2019-06-24 11:30:26 +02:00
daniel a rios b24e763846 Added tests for terminated path with optional arguments in django.urls.reverse(). 2019-06-24 11:30:26 +02:00
Tom Forbes e286711879 Simplified handling of non-existent paths in autoreloader with Path.resolve(strict=True). 2019-06-24 09:48:59 +02:00
Meysam 833878411c Fixed typo in docs/topics/db/models.txt. 2019-06-24 09:04:33 +02:00
Alexey Opalev 2f91e7832f Fixed typo in docs/ref/models/indexes.txt. 2019-06-24 08:58:56 +02:00
Mariusz Felisiak 19895e897c
Refs #30451 -- Added asgiref to the tests requirements. 2019-06-24 08:10:23 +02:00
Claude Paroz 8590726a5d Removed unneeded non-breaking spaces added in 00169bc36 2019-06-22 10:26:14 +02:00
Markus Holtermann ad7b438002 Bumped minimum ESLint version to 4.18.2. 2019-06-21 17:57:35 +02:00
Nadège Michel 87b1ad6e73 Fixed #30421 -- Allowed symmetrical intermediate table for self-referential ManyToManyField. 2019-06-21 15:03:17 +02:00
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