Nick Pope
65477fd7da
Added support for datetime.date to DateFormat.r().
2023-01-05 12:51:55 +01:00
Nick Pope
0fdc5d79b6
Simplified django.utils.formats.date_format()/time_format() calls.
...
This removes redundant get_format() calls and passing a default value
for the format argument.
2023-01-04 11:47:14 +01:00
GianpaoloBranca
8d67e16493
Fixed #33879 -- Improved timesince handling of long intervals.
2023-01-04 11:14:06 +01:00
David Wobrock
99bd5fb4c2
Refs #34074 -- Used headers argument for RequestFactory and Client in docs and tests.
2023-01-04 09:11:36 +01:00
Mike Crute
0b78ac3fc7
Fixed #34200 -- Made the session role configurable on PostgreSQL.
2023-01-03 09:30:53 +01:00
Claude Paroz
2a14b8df39
Fixed #33783 -- Added IsEmpty GIS database function and __isempty lookup on PostGIS.
2023-01-03 05:47:44 +01:00
Mariusz Felisiak
6774e9359c
Fixed #23842 -- Fixed flaky GeoQuerySetTest.test_make_line() test.
2023-01-03 05:46:40 +01:00
Florian Apolloner
afa2e28205
Fixed #34235 -- Added ManifestFilesMixin.manifest_hash attribute.
...
This adds ManifestFilesMixin.manifest_hash attribute exposing a "hash"
of the full manifest. This allows applications to determine when their
static files have changed.
2023-01-02 09:53:52 +01:00
Francesco Panico
c179ad9fe7
Refs #34100 -- Made file upload tests use Storage.exists() where appropriate.
2022-12-30 13:28:47 +01:00
Mariusz Felisiak
6e9e7ec472
Fixed random delete.tests.DeletionTests.test_deletion_order failures.
2022-12-30 12:22:30 +01:00
Paul Schilling
298d02a77a
Fixed #25617 -- Added case-insensitive unique username validation in UserCreationForm.
...
Co-Authored-By: Neven Mundar <nmundar@gmail.com>
2022-12-29 09:42:22 +01:00
Adrian Torres
7eee1dca42
Fixed #14094 -- Added support for unlimited CharField on PostgreSQL.
...
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-12-28 12:31:04 +01:00
kimsoungryoul
78f163a4fb
Fixed #18468 -- Added support for comments on columns and tables.
...
Thanks Jared Chung, Tom Carrick, David Smith, Nick Pope, and Mariusz
Felisiak for reviews.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2022-12-28 06:28:07 +01:00
DevilsAutumn
68ef274bc5
Fixed #34217 -- Fixed migration crash when removing check constraints on MySQL < 8.0.16.
2022-12-27 07:11:13 +01:00
朱穆穆
bbeeb45161
Fixed #34226 -- Fixed QuerySet.select_related() with multiple FilteredRelations to the OneToOneField.
2022-12-27 06:39:38 +01:00
David Wobrock
5aaad5f39c
Fixed #34165 -- Made permissions creation respect the "using" parameter.
2022-12-24 11:58:33 +01:00
Carlton Gibson
0bd2c0c901
Fixed #33735 -- Added async support to StreamingHttpResponse.
...
Thanks to Florian Vazelle for initial exploratory work, and to Nick
Pope and Mariusz Felisiak for review.
2022-12-22 10:41:12 +01:00
Mariusz Felisiak
ae0899be0d
Fixed #34219 -- Preserved Char/TextField.db_collation when altering column type.
...
This moves setting a database collation to the column type alteration
as both must be set at the same time.
This should also avoid another layer of the column type alteration when
adding database comments support (#18468 ).
2022-12-22 07:12:17 +01:00
Mariusz Felisiak
3b24a3fa33
Removed unnecessary commas in tests.
2022-12-21 11:41:29 +01:00
Carlton Gibson
32d70b2f55
Refs #34118 -- Adopted asgiref coroutine detection shims.
...
Thanks to Mariusz Felisiak for review.
2022-12-20 11:10:48 +01:00
Roxane
289e9a75af
Fixed #33662 -- Allowed Sitemap to customize languages for each item.
2022-12-19 12:51:52 +01:00
Andreas Pelme
ab7a85ac29
Fixed #34170 -- Implemented Heal The Breach (HTB) in GzipMiddleware.
2022-12-17 08:46:37 +01:00
Leo
a1bcdc94da
Fixed #34212 -- Made RedisCacheClient.incr() use write connection.
...
Co-authored-by: Sin-Woo Bang <sinwoobang@gmail.com>
2022-12-16 19:13:03 +01:00
Mariusz Felisiak
1e4da43955
Fixed lookup.tests.LookupTests.test_exact_none_transform() test on Oracle.
...
NulledTransform doesn't return TextField anymore so it cannot be
wrapped with DBMS_LOB.SUBSTR().
Test regression in 09ffc5c121
.
2022-12-16 12:24:49 +01:00
Daniele Varrazzo
09ffc5c121
Fixed #33308 -- Added support for psycopg version 3.
...
Thanks Simon Charette, Tim Graham, and Adam Johnson for reviews.
Co-authored-by: Florian Apolloner <florian@apolloner.eu>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-12-15 06:17:57 +01:00
Marti Raudsepp
32268456d6
Fixed #34209 -- Prevented FileBasedCache.has_key() crash caused by a race condition.
2022-12-13 19:29:15 +01:00
Florian Apolloner
db7bb3b64e
Refs #33308 -- Added DatabaseOperations.compose_sql() on PostgreSQL.
2022-12-12 10:36:45 +01:00
Florian Apolloner
1d90c9b113
Refs #33308 -- Added psycopg_any.IsolationLevel.
2022-12-12 10:36:42 +01:00
Florian Apolloner
2ebfbd894e
Refs #33308 -- Moved psycopg2 imports to the psycopg_any module.
2022-12-12 08:36:17 +01:00
James Gillard
c5ed884eab
Fixed #34205 -- Fixed Meta.constraints validation crash with ArrayField and __len lookup.
...
Regression in 88fc9e2826
that began
manifesting in Django 4.1.
2022-12-10 17:46:13 +01:00
SirAbhi13
b8738aea14
Fixed #33199 -- Deprecated passing positional arguments to Signer/TimestampSigner.
...
Thanks Jacob Walls for the implementation idea.
2022-12-09 12:44:48 +01:00
Mariusz Felisiak
9da2210f12
Avoided direct mocking of psycopg2.__version__ in test_correct_extraction_psycopg2_version().
2022-12-08 14:31:35 +01:00
Mariusz Felisiak
cbc0fb3705
Made inspectdb used Cursor.description.display_size for CharFields' max_length.
...
internal_size is size for fixed-size types not for char types.
2022-12-08 09:00:35 +01:00
Mariusz Felisiak
95a101a690
Fixed #34201 -- Bumped minimum supported SQLite to 3.21.0.
2022-12-08 05:53:18 +01:00
James Bligh
e44d348c99
Fixed #32319 -- Added ES module support to ManifestStaticFilesStorage.
...
Co-authored-by: James Bligh <james.bligh@silvercloudhealth.com>
2022-12-07 10:56:00 +01:00
Florian Apolloner
d8c8761901
Used homogeneous weights list in SearchRank tests.
...
A homogenous array is required on PostgreSQL.
2022-12-06 12:52:56 +01:00
Daniele Varrazzo
c14e5c64c9
Fixed typo in tests/postgres_tests/test_signals.py comment.
2022-12-06 12:52:56 +01:00
Florian Apolloner
6a21658163
Refs #33308 -- Modernized database wrapper in the PostgreSQL backend.
...
- Used connection.info instead of connection.get_parameter_status() and
connection.server_info which don't exist in psycopg 3.
- Set encoding using the client_encoding connection parameter instead
of connection.set_client_encoding() that doesn't exist in psycopg 3.
- Used the dbname connection parameter instead of deprecated
alias - database.
2022-12-06 12:48:16 +01:00
Mariusz Felisiak
29b6a177d8
Fixed AdminViewDeletedObjectsTest.test_cyclic failure when using --keepdb.
...
This changes to hardcoded pks when hardcoded fks are used.
2022-12-06 11:14:32 +01:00
Pablo
e673c87b56
Fixed #29084 -- Skipped some postgres_tests.test_search tests when pg_catalog isn't English.
2022-12-06 08:26:43 +01:00
Alex Vandiver
cbce427c17
Fixed #34194 -- Added django.utils.http.content_disposition_header().
2022-12-05 13:08:00 +01:00
Pablo
48531f53ae
Improved test coverage for django.db.transaction.
2022-12-05 10:46:33 +01:00
Simon Charette
eccda63a49
Improved isolation of TestGeneralAggregate.test_default_argument().
2022-12-02 13:58:46 +01:00
Florian Apolloner
3e3b7f691b
Refs #33308 -- Avoided passing None to RawSQL's params.
...
Passing None to params causes errors in determining the data type on
psycopg3.
2022-12-02 10:56:09 +01:00
Simon Charette
0ff46591ac
Refs #33308 -- Deprecated support for passing encoded JSON string literals to JSONField & co.
...
JSON should be provided as literal Python objects an not in their
encoded string literal forms.
2022-12-01 19:14:00 +01:00
Daniele Varrazzo
d3e746ace5
Refs #33308 -- Added get_type_oids() hook and simplified registering type handlers on PostgreSQL.
2022-12-01 11:05:57 +01:00
Florian Apolloner
149b55fefa
Refs #33308 -- Ensured type handlers are registered for all PostgreSQL specific tests.
...
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-12-01 09:39:46 +01:00
Florian Apolloner
3cafb783f3
Refs #33308 -- Used psycopg's errors instead of errorcodes.
2022-12-01 09:17:33 +01:00
Simon Charette
0db8bf3d60
Refs #10929 -- Fixed aggregates crash when passing strings as defaults.
...
Previously strings were interpreted as F() expressions and default
crashed with AttributeError:
'F' object has no attribute 'empty_result_set_value'
2022-11-29 13:08:05 +01:00
Giebisch
85b52d22fd
Fixed #33701 -- Added fine-grained error locations to the technical 500 debug page.
2022-11-29 08:40:11 +01:00
sdolemelipone
9d726c7902
Fixed #34187 -- Made UserCreationForm save many-to-many fields.
2022-11-29 05:56:53 +01:00
Mariusz Felisiak
60a7bd8986
Refs #34119 -- Skipped test_callable_default_hidden_widget_value_not_overridden when JSONField is not supported.
2022-11-28 09:47:52 +01:00
David Sanders
64b3c413da
Fixed #34103 -- Fixed logging SQL queries with duplicate parameters on Oracle.
2022-11-25 09:42:25 +01:00
Giebisch
80c66e40f7
Fixed #33747 -- Added exception notes to the technical 500 debug page.
2022-11-25 08:16:10 +01:00
Christophe Baldy
70c945d6b3
Used DatabaseFeatures.django_test_skips to skip AssertNumQueriesUponConnectionTests tests.
2022-11-24 19:41:08 +01:00
SirAbhi13
17472c3304
Fixed #34173 -- Skipped saving sessions on 5xx responses.
2022-11-24 15:46:41 +01:00
baldychristophe
855f5a36e7
Fixed #29062 -- Prevented possibility of database lock when using LiveServerTestCase with in-memory SQLite database.
...
Thanks Chris Jerdonek for the implementation idea.
2022-11-24 10:52:48 +01:00
Simon Charette
1297c0d0d7
Fixed #31679 -- Delayed annotating aggregations.
...
By avoiding to annotate aggregations meant to be possibly pushed to an
outer query until their references are resolved it is possible to
aggregate over a query with the same alias.
Even if #34176 is a convoluted case to support, this refactor seems
worth it given the reduction in complexity it brings with regards to
annotation removal when performing a subquery pushdown.
2022-11-23 17:46:07 +01:00
Mariusz Felisiak
a411b90967
Refs #33050 -- Added test for QuerySet.count() on combined queries with select_related().
...
Thanks Simon Charette for noticing this.
Fixed in 70499b25c7
.
2022-11-23 09:35:48 +01:00
DevilsAutumn
4035bab56f
Fixed #34171 -- Fixed QuerySet.bulk_create() on fields with db_column in unique_fields/update_fields.
...
Bug in 0f6946495a
.
Thanks Joshua Brooks for the report.
2022-11-22 14:47:21 +01:00
Mariusz Felisiak
7d5329852f
Fixed #34177 -- Fixed QuerySet.bulk_create() crash on "pk" in unique_fields.
...
Bug in 0f6946495a
.
2022-11-22 14:26:23 +01:00
Ilya Bass
798e38c2b9
Fixed #31090 -- Logged transaction management queries.
...
Thanks to Petter Strandmark for the original idea and Mariusz Felisiak
for advice during the DjangoConUS 2022 Sprint!
2022-11-21 09:10:14 +01:00
David Sanders
25904db915
Fixed #34119 -- Prevented callable default hidden widget value from being overridden.
...
Thanks to Benjamin Rigaud for the report.
2022-11-18 13:12:15 +01:00
roman_p
04b15022e8
Fixed #26261 -- Fixed queryset crash when excluding reverse GenericRelation.
...
Thanks Amir Hadi for the report.
2022-11-18 10:13:31 +01:00
Francesco Panico
51faf4bd17
Fixed #34148 -- Reverted "Fixed #32901 -- Optimized BaseForm.__getitem__()."
...
This reverts commit edde2a0699
.
Thanks Jan Pieter Waagmeester for the report.
2022-11-18 08:06:13 +01:00
Ben Cail
fbde929b19
Fixed #26056 -- Added QuerySet.values()/values_list() support for ArrayField's __overlap lookup.
...
Thanks Mads Jensen and kosz85 and the initial patch.
2022-11-18 05:53:37 +01:00
DevilsAutumn
81b1c167bf
Fixed #28987 -- Fixed altering ManyToManyField when changing to self-referential.
2022-11-17 12:36:52 +01:00
Mariusz Felisiak
67504ea505
Refs #34118 -- Skipped not compatible requirements on daily builds for Python 3.12.
2022-11-16 08:16:40 +01:00
Simon Charette
70499b25c7
Fixed #34123 -- Fixed combinator order by alias when using select_related().
...
Regression in c58a8acd41
.
Thanks to Shai Berger for the report and tests.
Co-Authored-By: David Sanders <shang.xiao.sanders@gmail.com>
2022-11-15 10:48:19 +01:00
David Wobrock
67da22f08e
Fixed #34074 -- Added headers argument to RequestFactory and Client classes.
2022-11-14 10:21:51 +01:00
Simon Charette
10037130c1
Refs #28477 -- Fixed handling aliased annotations on aggregation.
...
Just like when using .annotate(), the .alias() method will generate the
necessary JOINs to resolve the alias even if not selected.
Since these JOINs could be multi-valued non-selected aggregates must be
considered to require subquery wrapping as a GROUP BY is required to
combine duplicated tuples from the base table.
Regression in 59bea9efd2
.
2022-11-14 05:45:33 +01:00
Simon Charette
a9d2d8d1c3
Refs #28477 -- Reduced complexity of aggregation over qualify queries.
2022-11-11 08:46:08 +01:00
Francesco Panico
032c09c414
Refs #34110 -- Reorganized django.core.files.storage into a separate module.
2022-11-11 06:59:33 +01:00
Nick Pope
9bd174b9a7
Updated documentation and comments for RFC updates.
...
- Updated references to RFC 1123 to RFC 5322
- Only partial as RFC 5322 sort of sub-references RFC 1123.
- Updated references to RFC 2388 to RFC 7578
- Except RFC 2388 Section 5.3 which has no equivalent.
- Updated references to RFC 2396 to RFC 3986
- Updated references to RFC 2616 to RFC 9110
- Updated references to RFC 3066 to RFC 5646
- Updated references to RFC 7230 to RFC 9112
- Updated references to RFC 7231 to RFC 9110
- Updated references to RFC 7232 to RFC 9110
- Updated references to RFC 7234 to RFC 9111
- Tidied up style of text when referring to RFC documents
2022-11-10 13:52:17 +01:00
Márton Salomváry
d6cbf39a1b
Fixed #34149 -- Allowed adding deferrable conditional exclusion constraints on PostgreSQL.
2022-11-10 11:07:24 +01:00
Simon Charette
59bea9efd2
Fixed #28477 -- Stripped unused annotations on aggregation.
...
Also avoid an unnecessary pushdown when aggregating over a query that doesn't
have aggregate annotations.
2022-11-09 13:22:14 +01:00
Jon Janzen
321ecb40f4
Fixed #34135 -- Added async-compatible interface to related managers.
2022-11-09 10:32:40 +01:00
Scott Halgrim
c4eaa67e2b
Fixed #34063 -- Fixed reading request body with async request factory and client.
...
Co-authored-by: Kevan Swanberg <kevswanberg@gmail.com>
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2022-11-08 13:53:34 +01:00
Jon Janzen
7b94847e38
Fixed #34139 -- Fixed acreate(), aget_or_create(), and aupdate_or_create() methods for related managers.
...
Bug in 58b27e0dbb
.
2022-11-08 06:20:10 +01:00
Simon Charette
76e37513e2
Refs #33374 -- Adjusted full match condition handling.
...
Adjusting WhereNode.as_sql() to raise an exception when encoutering a
full match just like with empty matches ensures that all case are
explicitly handled.
2022-11-07 20:23:53 +01:00
Simon Charette
4b702c832c
Refs #33374 -- Added tests for multi-table fast-deletion with filters that match everything.
2022-11-07 20:23:53 +01:00
Simon Charette
5f09ab8c30
Refs #17144 -- Removed support for grouping by primary key.
...
No core backend require the feature anymore as it was only added to
support a MySQL'ism that has been deprecated since then.
2022-11-07 12:21:29 +01:00
Simon Charette
967f8750ab
Refs #27849 -- Fixed filtered aggregates crash on filters that match everything.
2022-11-07 09:05:24 +01:00
Simon Charette
77cf70ea96
Refs #27849 -- Added test for filtered aggregates with empty conditions.
2022-11-07 08:57:40 +01:00
Bhuvnesh
123b1d3fcf
Fixed #34137 -- Made Model.refresh_from_db() clear cached generic relations.
...
Thanks Simon Charette for the implementation idea.
2022-11-07 08:06:30 +01:00
Daniel Ivanov
5eab4d1924
Fixed #34088 -- Fixed Sitemap.get_latest_lastmod() crash with empty items.
...
Bug in 480191244d
.
Thanks Michal Čihař for the report.
2022-11-07 06:15:54 +01:00
LightDiscord
e20c9eb60a
Fixed #27654 -- Propagated alters_data attribute to callables overridden in subclasses.
...
Thanks Shai Berger and Adam Johnson for reviews and the implementation
idea.
2022-11-04 11:08:58 +01:00
Mariusz Felisiak
7b0e9ea53c
Fixed #34138 -- Avoided table rebuild when adding inline m2m fields on SQLite.
...
Regression in 2f73e5406d
.
Thanks David Wobrock for the report.
2022-11-04 09:30:23 +01:00
Bhuvnesh
e580b891cb
Refs #33646 -- Moved tests of QuerySet async interface into async tests.
2022-11-03 20:11:19 +01:00
Ion Alberdi
3dc9f3ac69
Fixed #34080 -- Fixed __exact lookup when nested arrays contain only NULL values.
...
Thanks jerch and David Sanders for reviews.
2022-11-03 06:59:49 +01:00
Ion Alberdi
34d63d5a41
Refs #34080 -- Added tests for __exact lookup when non-nested arrays contain only NULL values.
2022-11-03 06:39:34 +01:00
Mariusz Felisiak
57c2e5da71
Refs #33984 -- Added test for creating copies of model instances with inherited m2m fields.
2022-11-02 12:30:16 +01:00
DevilsAutumn
d5bcdf858d
Fixed #34112 -- Added async-compatible interface to Model methods.
...
Thanks Adam Johnson for the review.
2022-11-02 09:14:17 +01:00
Nick Pope
2bc47d7fe9
Avoided assignment followed by immediate return.
...
Identified using the following command:
$ pcre2grep --line-number --multiline --recursive \
"(?s)(\n +)(\w+) = [^\n]+\1return \2;?$" \
django docs extras js_tests scripts tests
2022-10-31 12:31:13 +01:00
Nick Pope
d3cb91db87
Used more augmented assignment statements.
...
Identified using the following command:
$ git grep -I '\(\<[_a-zA-Z0-9]\+\>\) *= *\1 *[-+/*^%&|<>@]'
2022-10-31 12:30:13 +01:00
David Wobrock
a320aab512
Fixed #16211 -- Added logical NOT support to F expressions.
2022-10-31 09:55:51 +01:00
Msvstl
67bc2f1b99
Corrected test_update_or_create_with_model_property_defaults test.
2022-10-29 13:27:10 +02:00
Simon Charette
c2cc80756b
Fixed #34125 -- Fixed sliced QuerySet.union() crash on a single non-empty queryset.
...
The bug existed since sliced query union was added but was elevated to
query union slices by moving the .exists() optimization to the compiler
in 3d734c09ff
.
Thanks Stefan Hammer for the report.
2022-10-29 09:21:25 +02:00
Simon Kern
de2c2127b6
Fixed #34066 -- Fixed link to password reset view in UserChangeForm.password's help text when using to_field.
...
Co-Authored-By: David Sanders <shang.xiao.sanders@gmail.com>
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-10-27 09:23:34 +02:00
Mariusz Felisiak
d559cb02da
Refs #19215 -- Fixed admin_widgets tests if Pillow isn't installed.
...
Follow up to c0fc1b5302
.
2022-10-27 08:41:03 +02:00
Tobias Bengfort
350455b666
Fixed #33606 -- Cleansed sessionid cookie in error reports.
...
Co-authored-by: Simon Charette <charette.s@gmail.com>
2022-10-26 14:39:58 +02:00
Marcelo Galigniana
b440493eaa
Completed test coverage for contrib.auth.forms.
2022-10-26 12:52:18 +02:00
Marcelo Galigniana
c0fc1b5302
Fixed #19215 -- Fixed rendering ClearableFileInput when editing with invalid files.
...
Thanks Michael Cardillo for the initial patch.
2022-10-25 16:53:52 +02:00
Yuri Konotopov
64e5ef1f17
Fixed #29027 -- Fixed file_move_safe() crash when moving files with SELinux.
...
Thanks Florian Apolloner for the review.
2022-10-24 13:54:51 +02:00
Vlastimil Zíma
08c5a78726
Fixed #34098 -- Fixed loss of precision for Decimal values in floatformat filter.
...
Regression in 12f7928f5a
.
2022-10-24 12:59:34 +02:00
Marcelo Galigniana
1d6948096f
Fixed flaky test_ForeignKey_using_to_field test.
2022-10-24 11:54:00 +02:00
Giebisch
3283120cca
Fixed #34111 -- Made test runner with --debug-sql format SQL queries.
2022-10-24 08:11:30 +02:00
HieuPham9720
3e928de8ad
Skipped scrypt tests when OpenSSL 1.1+ is not installed.
2022-10-20 18:50:48 -07:00
Carlton Gibson
5c2c7277d4
Fixed #34085 -- Made management commands don't use black for non-Python files.
...
Bug in d113b5a837
.
Co-authored-by: programmylife <acmshar@gmail.com>
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2022-10-20 13:38:31 -07:00
Simon Charette
d62563cbb1
Fixed #34105 -- Fixed crash of ordering by nested selected expression.
...
This stops ordering by nested selected references. It's not supported on
PostgreSQL and not required to support psycopg3.
Regression in 04518e310d
.
Thanks Matt Westcott for the report.
2022-10-18 17:31:45 -07:00
Marcelo Galigniana
2a2503c2c1
Completed test coverage for django.core.paginator.
2022-10-13 12:27:41 +02:00
Sergio
94e7f471c4
Fixed #34069 -- Made LocaleMiddleware respect language from requests when i18n patterns are used.
2022-10-13 10:38:26 +02:00
Rasmus Magnell
c4aac2ac1e
Fixed #34042 -- Improved accessibility of admin's navigation sidebar.
2022-10-12 10:21:17 +02:00
Marcelo Galigniana
f30c7e381c
Completed test coverage for contenttypes models.
2022-10-11 05:38:39 +02:00
Adam Johnson
6402b064a9
Used test client headers in i18n tests.
2022-10-10 11:46:31 +02:00
Sarah Boyce
84206607d6
Fixed #32833 -- Fixed ContentTypeManager.get_for_models() crash when using in migrations.
...
Co-authored-by: Heraldo Lucena <23155511+HMaker@users.noreply.github.com>
2022-10-10 08:57:52 +02:00
Gregor Gärtner
f0c06f8ab7
Refs #33990 -- Renamed TransactionTestCase.assertQuerysetEqual() to assertQuerySetEqual().
...
Co-Authored-By: Michael Howitz <mh@gocept.com>
2022-10-08 08:07:38 +02:00
Mariusz Felisiak
d795259ea9
Replaced assertQuerysetEqual() to assertSequenceEqual()/assertCountEqual() where appropriate.
...
Follow up to 3f7b327562
.
2022-10-07 13:05:35 +02:00
Gregor Gärtner
564b317fb5
Refs #33990 -- Renamed SimpleTestCase.assertFormsetError() to assertFormSetError().
...
Co-Authored-By: Michael Howitz <mh@gocept.com>
2022-10-07 11:22:16 +02:00
Mariusz Felisiak
749cd83e13
Removed hardcoded pks in TestQuerying.test_group_by_order_by_aliases test.
2022-10-07 08:26:41 +02:00
Shubh1815
7a39a691e1
Fixed #32603 -- Made ModelAdmin.list_editable use transactions.
2022-10-06 20:44:07 +02:00
Simon Charette
c6350d594c
Refs #30158 -- Removed alias argument for Expression.get_group_by_cols().
...
Recent refactors allowed GROUP BY aliasing allowed for aliasing to be
entirely handled by the sql.Query.set_group_by and compiler layers.
2022-10-06 12:04:00 +02:00
Simon Charette
b7b28c7c18
Refs #31150 -- Enabled implicit GROUP BY aliases.
...
This ensures implicit grouping from aggregate function annotations
groups by uncollapsed selected aliases if supported.
The feature is disabled on Oracle because it doesn't support it.
2022-10-06 11:51:32 +02:00
Simon Charette
3d734c09ff
Refs #33992 -- Refactored subquery grouping logic.
...
This required moving the combined queries slicing logic to the compiler
in order to allow Query.exists() to be called at expression resolving
time.
It allowed for Query.exists() to be called at Exists() initialization
time and thus ensured that get_group_by_cols() was operating on the
terminal representation of the query that only has a single column
selected.
2022-10-06 11:38:03 +02:00
Simon Charette
04518e310d
Refs #33308 -- Enabled explicit GROUP BY and ORDER BY aliases.
...
This ensures explicit grouping from using values() before annotating an
aggregate function groups by selected aliases if supported.
The GROUP BY feature is disabled on Oracle because it doesn't support it.
2022-10-06 09:34:31 +02:00
Simon Charette
c58a8acd41
Fixed #33768 -- Fixed ordering compound queries by nulls_first/nulls_last on MySQL.
...
Columns of the left outer most select statement in a combined query
can be referenced by alias just like by index.
This removes combined query ordering by column index and avoids an
unnecessary usage of RawSQL which causes issues for backends that
specialize the treatment of null ordering.
2022-10-05 14:04:49 +02:00
Jack Linke
344d31c7e9
Fixed #34071 -- Improved error message for Range(Min/Max)ValueValidator.
2022-10-05 09:41:01 +02:00
Dhanush
9fbb5b5e16
Fixed #34068 -- Corrected output of runserver command for "0" IP address.
...
Thanks David Sanders for the review.
2022-10-04 10:13:32 +02:00
Adam Johnson
e5ea284294
Fixed CVE-2022-41323 -- Prevented locales being interpreted as regular expressions.
...
Thanks to Benjamin Balder Bach for the report.
2022-10-04 09:10:04 +02:00
David Sanders
4771a1694b
Fixed #34012 -- Made QuerySet.order_by() apply transforms on related fields for models with Meta.ordering.
...
This makes QuerySet.order_by() no longer ignore trailing transforms for
models with Meta.ordering. As a consequence, FieldError is raised in
such cases for non-existent fields.
Thanks to Klaas van Schelven for the report and Mariusz Felisiak for the
review and advice.
2022-10-04 08:19:34 +02:00
Lily Foote
649b28eab6
Fixed #34070 -- Added subsecond support to Now() on SQLite and MySQL.
2022-10-03 12:13:27 +02:00
Mariusz Felisiak
f71b0cf769
Refs #32987 -- Relaxed system check for template tag modules with the same name by turning into a warning.
...
Thanks Claude Paroz for the report.
Regression in 004b4620f6
.
2022-10-03 10:52:21 +02:00
David Wobrock
3b4a5b9f97
Fixed #23353 -- Used "raise from" when raising TransactionManagementError.
...
This change sets the __cause__ attribute to raised exceptions.
2022-10-03 06:08:54 +02:00
Mariusz Felisiak
bc3b8f1524
Refs #34058 -- Fixed changing/deleting sequences when altering pre-Django 4.1 auto fields on PostgreSQL.
...
Thanks Anders Kaseorg for the report.
Follow up to 19e6efa50b
.
Regression in 2eea361eff
.
2022-10-01 07:53:32 +02:00
Mariusz Felisiak
5e0aa362d9
Fixed #33984 -- Reverted "Fixed #32980 -- Made models cache related managers."
...
This reverts 4f8c7fd9d9
and adds
two regression tests:
- test_related_manager_refresh(), and
- test_create_copy_with_m2m().
Thanks joeli for the report.
2022-09-30 18:18:33 +02:00
sarahboyce
6cc0f22a73
Fixed #32095 -- Made QuerySet.update_or_create() save only fields passed in defaults or with custom pre_save().
...
Thanks Florian Apolloner for the initial patch.
2022-09-30 06:26:19 +02:00
Antoine Lorence
9b0c9821ed
Fixed #34062 -- Updated View.http_method_not_allowed() to support async.
...
As with the options() methods, wrap the response in a coroutine if
the view is async.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2022-09-29 16:28:44 +02:00
Mariusz Felisiak
19e6efa50b
Fixed #34058 -- Changed sequence types when altering pre-Django 4.1 auto fields on PostgreSQL.
...
Thanks Anders Kaseorg for the report.
Thanks Florian Apolloner for pair programming.
Regression in 2eea361eff
.
2022-09-29 13:20:14 +02:00
Adam Johnson
0f5b11eca0
Refs #34010 -- Made --debug-mode work for parallel tests using spawn.
...
Bug in 3b3f38b3b0
.
Thanks Kevin Renskers for the report.
2022-09-28 19:39:25 +02:00
David Sanders
9976f3d4b8
Fixed #34025 -- Fixed selecting ModelAdmin.autocomplete_fields after adding/changing related instances via popups.
...
Regression in c72f6f36c1
.
Thanks Alexandre da Silva for the report.
2022-09-28 11:28:01 +02:00
Mariusz Felisiak
6e891a1722
Removed obsolete test_skip_link_is_skipped_when_there_is_searchbar test.
...
searchbar doesn't have autofocus since
d938b3b257
.
2022-09-28 11:27:11 +02:00
Jacob Walls
80d38de52b
Fixed #34051 -- Made makemigrations --check exit before making migrations.
2022-09-28 09:48:07 +02:00
JunKi Yoon
1a7b6909ac
Fixed #34052 -- Made migrate --check don't emit signals and output when up to date.
2022-09-27 21:10:30 +02:00
David Wobrock
cff1f888e9
Fixed #33464 -- Resolved output_field for combined numeric expressions with MOD operator.
2022-09-27 20:41:10 +02:00
sarahboyce
ae3d575ec3
Added tests for QuerySet.update_or_create() with multi-table inheritance.
2022-09-27 12:55:33 +02:00
Marcelo Galigniana
67c34c1a37
Completed test coverage for createsuperuser command.
2022-09-27 09:57:16 +02:00
Adam Johnson
cd03e8e2d6
Fixed #34050 -- Replaced invalid chars in migration names with '_'.
...
Thanks to Bishal Gautam for the report and initial implementation.
Regression in fa58450a9a
.
Co-Authored-By: Bishal Gautam <bisalgt@gmail.com>
2022-09-27 08:02:51 +02:00
Moshe Nahmias
d938b3b257
Fixed #34040 -- Removed autofocus from admin search box.
2022-09-26 21:06:48 +02:00
Mariusz Felisiak
f4e592e383
Removed unnecessary MySQL workaround in timezones tests.
...
Unnecessary since 22da5f8817
.
2022-09-26 13:36:47 +02:00
Florian Perucki
872b61193b
Refs #34041 -- Added navigation landmark to breadcrumbs in admin.
...
Thanks Thibaud Colas for pair programming.
2022-09-26 08:51:15 +02:00