Commit Graph

18738 Commits

Author SHA1 Message Date
Claude Paroz f2dd652245 Fixed #33863 -- Fixed JavaScriptCatalog with more than 1 level of fallback translations.
Co-authored-by: Carlos Mermingas <cmermingas@gmail.com>
2022-07-25 08:45:46 +02:00
Anders Kaseorg 9ba2e8821f
Removed obsolete note in management.get_commands() docstring.
Commit 901c3708fb documented that the
return dict could directly include command modules instead of name
strings, which was true at the time. However, that possibility was
removed in commit 38f1fe3b35.
2022-07-25 07:55:52 +02:00
Ikko Ashimine 85df081add
Fixed typo in django/contrib/admin/options.py comment. 2022-07-25 07:19:52 +02:00
Claude Paroz 3b79dab19a Refs #33691 -- Deprecated insecure password hashers.
SHA1PasswordHasher, UnsaltedSHA1PasswordHasher, and UnsaltedMD5PasswordHasher
are now deprecated.
2022-07-23 21:29:31 +02:00
Nick Pope 4d4bf55e0e Fixed #33864 -- Deprecated length_is template filter. 2022-07-23 12:36:21 +02:00
Mariusz Felisiak f810325721
Refs #27236 -- Made cosmetic edits to Meta.index_together deprecation.
This should make it more straightforward to move forward when
deprecation ends.
2022-07-21 07:05:50 +02:00
Mariusz Felisiak 0e76abb8c4
Stopped using default adapters/converters on SQLite backend.
Default adapters/converters were deprecated in Python 3.12,
see https://github.com/python/cpython/issues/90016.
2022-07-21 07:03:32 +02:00
Leonid Podriz eae973df66
Fixed #33833 -- Corrected .closelink admin CSS.
Co-authored-by: Leonid Podriz <leonidpodriz@pm.me>
2022-07-20 21:58:10 +02:00
Mariusz Felisiak 24effbceb8
Fixed #33855 -- Removed unnecessary system check calls from test worker initialization.
Regression in 3b3f38b3b0.
2022-07-19 09:45:11 +02:00
Jarrett Keifer 3e3e814166
Fixed #33854 -- Corrected the order of parameters in dbshell on PostgreSQL. 2022-07-18 06:30:20 +02:00
Alexander Freyr L b4817d20b9 Fixed #33728 -- Reordered submit buttons in admin.
Thanks Tom Carrick and Thibaud Colas for reviews.
2022-07-17 13:23:53 +02:00
Iuri de Silvio f0fa2a3b49 Fixed #33848 -- Optimized StateApps.clone(). 2022-07-16 10:12:32 +02:00
cheng d4c5d2b52c Fixed #33631 -- Marked {% blocktranslate asvar %} result as HTML safe. 2022-07-14 11:09:19 +02:00
David Wobrock a6385b382e
Fixed #27236 -- Deprecated Meta.index_together in favor of Meta.indexes.
This also deprecates AlterIndexTogether migration operation.
2022-07-12 09:04:31 +02:00
Tim Graham 282d58e193
Refs #25232 -- Simplified ModelBackend.user_can_authenticate().
Thanks Jay Turner for the suggestion.
2022-07-11 20:27:11 +02:00
Mariusz Felisiak 5e2f4ddf29
Refs CVE-2022-34265 -- Unified DatabaseOperations._convert_*_to_tz() hook names. 2022-07-09 13:02:07 +02:00
Mariusz Felisiak eb3699ea77
Fixed #33718 -- Dropped support for MySQL 5.7. 2022-07-08 13:30:12 +02:00
Stéphane "Twidi" Angel ccbf714ebe Fixed #33829 -- Made BaseConstraint.deconstruct() and equality handle violation_error_message.
Regression in 667105877e.
2022-07-08 08:17:42 +02:00
David Wobrock 41019e48bb Refs #27236 -- Added generic mechanism to handle the deprecation of migration operations. 2022-07-08 07:05:55 +02:00
David Wobrock 57793b4765 Refs #27236 -- Refactored out DeprecationForHistoricalMigrationMixin. 2022-07-07 12:21:35 +02:00
Carlton Gibson 6f80050496 Fixed #33781 -- Restored alignment for admin split-field timezone warnings.
Regression in f3e2bb0833.
Refs #33750 and #27207.
2022-07-07 11:32:05 +02:00
Christos Kopanos 608ab043f7 Fixed #33826 -- Fixed RedisCache.set_many()/delete_many() crash with an empty list. 2022-07-06 10:45:52 +02:00
Christos Kopanos fcee0d3fb6 Used list comprehensions in RedisCache.delete_many(). 2022-07-06 10:37:20 +02:00
Vladimir Kochetkov 3926e35aa8 Fixed #33823 -- Made inspectdb generate unique related_name when reverse accessor clashes. 2022-07-06 09:35:50 +02:00
Simon Charette 877c800f25 Refs CVE-2022-34265 -- Properly escaped Extract() and Trunc() parameters.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-07-06 07:40:07 +02:00
Shawn Dong 18c5ba07cc Fixed #33822 -- Fixed save() crash on model formsets when not created by modelformset_factory().
Thanks Claude Paroz for the report.

Regression in e87f57fdb8.
2022-07-05 07:19:18 +02:00
Mariusz Felisiak 249ecc437f
Fixed #33815 -- Fixed last_executed_query() on Oracle when parameter names overlap. 2022-07-05 05:53:49 +02:00
Mariusz Felisiak 54eb8a374d Fixed CVE-2022-34265 -- Protected Trunc(kind)/Extract(lookup_name) against SQL injection.
Thanks Takuto Yoshikai (Aeye Security Lab) for the report.
2022-07-04 08:13:41 +02:00
Ipakeev 425718726b
Fixed #33816 -- Fixed QuerySet.only() after select_related() crash on proxy models. 2022-07-04 06:37:36 +02:00
Michael Manfre 03eec9ff6c Updated vendored _urlsplit() to strip newline and tabs.
Refs Python CVE-2022-0391. Django is not affected, but others who
incorrectly use internal function url_has_allowed_host_and_scheme()
with unsanitized input could be at risk.
2022-07-01 08:48:38 +02:00
Hrushikesh Vaidya 72e41a0df6 Fixed #33779 -- Allowed customizing encoder class in django.utils.html.json_script(). 2022-06-28 10:54:38 +02:00
Mehrdad d4d5427571 Refs #33697 -- Used django.utils.http.parse_header_parameters() for parsing boundary streams.
This also removes unused parse_header() and _parse_header_params()
helpers in django.http.multipartparser.
2022-06-28 09:42:47 +02:00
Mariusz Felisiak bff5c114be
Removed unnecessary _parse_header() from MultiPartParser.
Reraising ValueError was unused since its introduction in
d725cc9734.
2022-06-28 09:27:03 +02:00
Mehrdad d6e0c7c30c Refs #33697 -- Made MediaType use django.utils.http.parse_header_parameters(). 2022-06-28 07:33:41 +02:00
Ankur eb7b8f3699 Fixed #33805 -- Made admin's many-to-many widgets do not display help text for selecting values when allow_multiple_selected is False. 2022-06-28 06:04:42 +02:00
Mariusz Felisiak c48b34e26d Refs #32786 -- Made query clear ordering when ordered combined queryset is used in subquery on Oracle. 2022-06-27 06:21:31 +02:00
Mariusz Felisiak 20b6e30858 Refs #33713 -- Removed unnecessary skip for MariaDB 10.3. 2022-06-27 06:21:31 +02:00
Mariusz Felisiak 44ffd8d06f Fixed #33796 -- Fixed ordered combined queryset crash when used in subquery on PostgreSQL and MySQL.
Thanks Shai Berger for the report.

Regression in 30a0144134.
2022-06-27 06:21:31 +02:00
Mariusz Felisiak 083bfca6b6
Fixed #33800 -- Fixed system check for the same template tag module in installed apps and template tag libraries.
Thanks Claude Paroz for the report.

Regression in 004b4620f6.
2022-06-23 20:22:59 +02:00
DhruvaPatil98 c627226d05 Fixed #33799, Refs #31685 -- Added parameters for updating conflicts to QuerySeta.abulk_create(). 2022-06-23 11:12:35 +02:00
Florian Apolloner e6f36ea0a9 Made HashedFilesMixin ignore URLs without a path. 2022-06-23 08:59:49 +02:00
Marcelo Galigniana d80a258553 Fixed #33028 -- Used ModelAdmin's opts attribute instead of model._meta. 2022-06-22 07:50:24 +02:00
Claude Paroz de74a74b4b Fixed #33794 -- Fixed string-casting of GIS queries on PostgreSQL.
Regression in 64c3f049ea.
2022-06-21 10:10:37 +02:00
Abhinav Yadav 2887b9f67c
Fixed #33657 -- Allowed customizing formatter class of argument parsers. 2022-06-20 17:34:52 +02:00
Anv3sh d7f5bfd241 Fixed #32969 -- Fixed pickling HttpResponse and subclasses. 2022-06-20 08:51:26 +02:00
Zainab Amir 901a169198 Fixed #23689 -- Made parsing HTTP Accept-Language header case-insensitive.
Thank you Daniel Samuels for test project.
2022-06-20 07:40:28 +02:00
Ankur d19a53d8e3 Fixed #33784 -- Removed unnecessary format escaping in admin calendar widget.
Replacements were added in fa0653cd1d
where we created a callback function by concatenating strings. It's
unnecessary since d638cdc42a.
2022-06-18 20:21:28 +02:00
Matt Brewer 8d160f154f Fixed #33788 -- Added TrigramStrictWordSimilarity() and TrigramStrictWordDistance() on PostgreSQL. 2022-06-17 11:14:30 +02:00
David Wobrock 3ef37a5245 Fixed #28897 -- Fixed QuerySet.update() on querysets ordered by annotations. 2022-06-17 10:06:17 +02:00
David Wobrock f4680a112d Refs #28897 -- Added test for QuerySet.update() on querysets ordered by inline m2m annotation. 2022-06-17 10:06:12 +02:00
David Wobrock e286ce17ff Fixed #24870 -- Added --update option to makemigrations command. 2022-06-17 07:50:39 +02:00
David Wobrock 3893fcdd94 Refs #24870 -- Refactored out get_relative_path() hook in makemigrations. 2022-06-17 06:02:42 +02:00
Mariusz Felisiak 759ff4862a
Fixed #33786 -- Confirmed support for GDAL 3.5. 2022-06-16 09:44:19 +02:00
Pablo Pissi d287294885 Fixed #33772 -- Added QuerySet.first()/last() error message on unordered queryset with aggregation. 2022-06-14 12:24:43 +02:00
Bruce Cutler de1c8320ce Fixed #33773 -- Made Index with multiple fields respect DEFAULT_INDEX_TABLESPACE.
Thanks to Simon Charette for locating where issue lay.
2022-06-13 07:21:46 +02:00
Ebram Shehata 4996eaa7b5
Made QuerySet.bulk_update() raise an error when batch_size is zero. 2022-06-13 06:25:25 +02:00
Jonas Lundberg e96320c917 Fixed #33755 -- Moved ASGI body-file cleanup into request class. 2022-06-09 11:11:45 +02:00
Ronnie van den Crommenacker c32858a8ce Fixed #33565 -- Improved locale format validation for the makemessages command. 2022-06-08 16:17:12 +02:00
Mehrdad 49b470b918 Refs #33697 -- Made MultiPartParser use django.utils.http.parse_header_parameters() for parsing Content-Type header. 2022-06-03 21:37:29 +02:00
Swann d0863429a3 Fixed documentation of Widget.id_for_label() empty return value. 2022-06-03 12:19:47 +02:00
Ciaran McCormick 286e7d076c Fixed #33764 -- Deprecated BaseUserManager.make_random_password(). 2022-06-03 07:30:57 +02:00
Anders Kaseorg fbac2a4dd8 Fixed #33700 -- Skipped extra resolution for successful requests not ending with /.
By moving a should_redirect_with_slash call out of an if block, commit
9390da7fb6 negated the performance fix
of commit 434d309ef6 (#24720).
Meanwhile, the logging issue #26293 that it targeted was subsequently
fixed more fully by commit 40b69607c7
(#26504), so it is no longer needed.  This effectively reverts it.

This speeds up successful requests not ending with / when APPEND_SLASH
is enabled (the default, and still useful in projects with a mix of
URLs with and without trailing /).  The amount of speedup varies from
about 5% in a typical project to nearly 50% on a benchmark with many
routes.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2022-06-02 15:15:04 +02:00
David Wobrock 798b6c23ee
Fixed #31788 -- Fixed migration optimization after altering field to ManyToManyField.
This makes AddField() used for altering to ManyToManyField, dependent
on the prior RemoveField.
2022-06-02 12:10:27 +02:00
Samir Shah 6f73eb9d90 Fixed #33742 -- Added id to GeoJSON serializer. 2022-06-01 19:11:26 +02:00
Florian Demmer f3e2bb0833
Fixed #33750 -- Fixed timezone warning alignment with help texts.
Previously help_text was wrapped in a paragraph, but the change to div
broke the alignment, refs #27207.
2022-06-01 11:41:15 +02:00
kshivakumar 46efd03d26 Fixed #33733 -- Preserved wrapper assignment for manager methods. 2022-06-01 10:44:34 +02:00
Mehrdad 93cedc82f2 Refs #33697 -- Fixed multipart parsing of headers with double quotes and semicolons.
See 1ef0c0349e
2022-06-01 10:11:07 +02:00
Anv3sh 295249c901 Fixed #32234 -- Made inspectdb inform about composite primary keys. 2022-06-01 08:40:44 +02:00
Allen Jonathan David 1058fc7023 Fixed #33191 -- Avoided clearing cached reference when saving child after parent.
Thanks Barry Johnson for the report.
2022-05-31 10:19:54 +02:00
Jonas Lundberg f1e0fc645b Fixed #33754 -- Fixed crash with prematurely closed ASGI request body.
Regression in 441103a04d.
2022-05-31 08:38:00 +02:00
Claude Paroz 292f372768 Fixed #33748 -- Fixed date template filter crash with lazy format.
Regression in 659d2421c7.
2022-05-31 06:09:39 +02:00
Marcelo Galigniana 8c0886b068 Fixed #22078 -- Fixed crash of Feed with decorated methods. 2022-05-26 10:39:51 +02:00
David Wobrock b949e40e8c Fixed #23740 -- Fixed removing unique_together constraint if exists primary key/unique constraint on the same field. 2022-05-26 08:33:07 +02:00
David Wobrock 115a978fce Refs #23740 -- Added BaseDatabaseSchemaEditor._unique_constraint_name(). 2022-05-26 07:31:24 +02:00
Aymeric Augustin 8cf4de206c Normalized decorator style for functools.wraps. 2022-05-25 10:58:48 +02:00
Aymeric Augustin aff649a3bd Normalized imports of functools.wraps.
@wraps is 10 times more common than @functools.wraps. Standardize to
the most common version.
2022-05-25 10:58:28 +02:00
Aymeric Augustin 6485894157 Renamed wrapped functions to wrapper.
All these functions are wrapping another function. They're the wrapper,
while the function they're wrapping is the wrapped.
2022-05-25 10:53:52 +02:00
Sankalp 90dcf27114 Fixed #33725 -- Made hidden quick filter in admin's navigation sidebar not focusable.
Regression in d915dd1c58.

Follow up to 780473d756.
2022-05-21 13:37:53 +02:00
Mohammed Y. Alnajdi 78bf1565c3 Fixed #33727 -- Fixed color contrasts in admin header. 2022-05-21 12:35:10 +02:00
cheng 0dd2920909 Fixed #33653 -- Fixed template crash when calling methods for built-in types without required arguments.
Regression in 09341856ed.
2022-05-20 07:53:05 +02:00
Hasan Ramezani 1a78ef2b85
Fixed #33715 -- Allowed keyboard interrupt to abort queries in MySQL dbshell. 2022-05-20 07:11:51 +02:00
Mariusz Felisiak 41c4cb253c
Fixed #33719 -- Fixed test command crash when running in parallel.
Thanks Pēteris Caune for the report.

Regression in 3b3f38b3b0.
2022-05-19 10:20:51 +02:00
Mariusz Felisiak 981c23c0cc
Fixed #33717 -- Dropped support for PostgreSQL 11. 2022-05-19 09:26:48 +02:00
David Wobrock 9f55489529 Fixed #33705 -- Fixed crash when using IsNull() lookup in filters.
Thanks Florian Apolloner for the report.
Thanks Simon Charette for the review.
2022-05-19 07:02:22 +02:00
Mariusz Felisiak 19297de2fe
Fixed #33713 -- Dropped support for MariaDB 10.3. 2022-05-18 08:38:08 +02:00
Mariusz Felisiak 2cec020f5b Refs #33379 -- Fixed minimum supported version of MariaDB. 2022-05-17 14:59:28 +02:00
Carlton Gibson 3c6f1fd1f8 Increased the default PBKDF2 iterations for Django 4.2. 2022-05-17 14:22:06 +02:00
Carlton Gibson cdb2f7f36c Advanced deprecation warnings for Django 4.2. 2022-05-17 14:22:06 +02:00
Carlton Gibson ff8e5eacda Bumped version; main is now 4.2 pre-alpha. 2022-05-17 14:22:06 +02:00
Mariusz Felisiak 4286378a08 Updated source translation catalogs.
Forward port of d1f1a0168a from
stable/4.1.x.
2022-05-17 14:17:07 +02:00
David Smith d126eba363 Refs #32339 -- Deprecated default.html form template.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2022-05-17 11:16:54 +02:00
Alokik Vijay 7f3cfaa12b Fixed #32565 -- Moved internal URLResolver view-strings mapping to admindocs.
Moved the functionality of URLResolver._is_callback(),
URLResolver._callback_strs, URLPattern.lookup_str() to
django.contrib.admindocs.
2022-05-17 10:50:09 +02:00
Collin Anderson 2a5d2eefc7 Fixed #33683 -- Document HttpResponseBase and allow import from django.http 2022-05-17 09:51:16 +02:00
David Wobrock 97f124f39e Refs #27064 -- Made migrations generate RenameIndex operations when moving indexes from index_together to Meta.indexes. 2022-05-17 07:21:36 +02:00
David Wobrock a098cde968 Refs #27064 -- Refactored out MigrationAutodetector.create_renamed_fields(). 2022-05-17 06:20:01 +02:00
David Wobrock c6cec3c2d2 Refs #27064 -- Made migrations generate RenameIndex operations when renaming Meta.indexes. 2022-05-16 17:46:24 +02:00
David Wobrock 11310e9abb Fixed #33710 -- Made RenameIndex operation a noop when the old and new name match. 2022-05-16 10:36:56 +02:00
Marcelo Galigniana 76af861356 Fixed #27550 -- Allowed GEOSGeometry.normalize() to return a normalized clone. 2022-05-16 06:46:53 +02:00
Mariusz Felisiak d27e6b233f
Fixed #33681 -- Made Redis client pass CACHES["OPTIONS"] to a connection pool.
Thanks Ben Picolo for the report.
2022-05-16 06:17:40 +02:00
Nick Pope d3677043fc Added backward compatibility test for ConnectionHandler.databases property.
The ConnectionHandler.databases property is no longer used within
Django, but it is maintained for backward compatibility with 3rd party
packages that have used this private API in the past.
2022-05-13 12:01:07 +02:00
非法操作 19dc3f0f96 Fixed typo in Query.clone()'s docstring. 2022-05-13 06:56:20 +02:00
David Wobrock eacd4977f6 Refs #27064 -- Added RenameIndex migration operation. 2022-05-12 20:44:03 +02:00
Nick Pope 20e65a34ae
Made closing in connection handlers more DRY. 2022-05-12 15:13:51 +02:00
Kapil Bansal 3a82b5f655 Fixed #32559 -- Added 'step_size’ to numeric form fields.
Co-authored-by: Jacob Rief <jacob.rief@uibk.ac.at>
2022-05-12 14:16:52 +02:00
Mariusz Felisiak 68da6b389c
Fixed #33543 -- Deprecated passing nulls_first/nulls_last=False to OrderBy and Expression.asc()/desc().
Thanks Allen Jonathan David for the initial patch.
2022-05-12 11:30:03 +02:00
Ed Rivas 2798c937de Fixed #29538 -- Fixed crash of ordering by related fields when Meta.ordering contains expressions.
Thanks Simon Charette for the review.
2022-05-12 07:19:16 +02:00
Carlton Gibson 34e2148fc7 Refs #33173 -- Removed use of deprecated cgi module.
https://peps.python.org/pep-0594/#cgi
2022-05-11 14:06:31 +02:00
Mariusz Felisiak 02dbf1667c
Fixed #33691 -- Deprecated django.contrib.auth.hashers.CryptPasswordHasher. 2022-05-11 09:13:45 +02:00
Marc Seguí Coll 262fde94de Fixed #33622 -- Allowed customizing error messages for invalid number of forms.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-05-10 13:42:31 +02:00
Gagaro 667105877e Fixed #30581 -- Added support for Meta.constraints validation.
Thanks Simon Charette, Keryn Knight, and Mariusz Felisiak for reviews.
2022-05-10 11:22:23 +02:00
Mariusz Felisiak 441103a04d
Refs #33173, Refs #30451 -- Fixed ResourceWarning from unclosed body files in ASGI handler on Python 3.11+. 2022-05-10 09:57:28 +02:00
Nikita Sobolev 21d8ea4eb3
Corrected extract_views_from_urlpatterns()'s docstring. 2022-05-06 09:50:46 +02:00
Daniel Hahler dddc8bc47d Fixed #33679 -- Fixed the last inline's id in admin for users without add permissions. 2022-05-06 08:36:04 +02:00
David Smith ec5659382a Fixed #32339 -- Added div.html form template. 2022-05-05 14:32:43 +02:00
Stefan Brand c5cc750b56
Corrected example in Polygon docstring. 2022-05-04 17:31:42 +02:00
David Wobrock 8f04473af1 Fixed #25105 -- Checked deferred constraints before updating rows on PostgreSQL. 2022-05-04 12:15:00 +02:00
Gagaro 5d91dc8ee3 Refs #30581 -- Added Q.check() hook. 2022-05-04 08:47:52 +02:00
Simon Charette 1109e66990
Refs #33646 -- Reduced sync_to_async hops on async QuerySet iteration.
Until we add support for truly asynchronous database backends it's
actually detrimental to have complete set retrieval require multiple
hops between sync and async emulated contexts via asgiref.

By defaulting to sending the whole sync _fetch_all() to the current
context thread pool we reduce unncessary work when dealing with large
result sets since the queryset cannot be iterated anyway before all
results are retrieved and cached.
2022-05-04 08:31:59 +02:00
Mariusz Felisiak 37470bbd90
Fixed #33675 -- Dropped support for PostgreSQL 10 and PostGIS 2.4. 2022-05-04 06:28:51 +02:00
Gagaro 9d04711261 Refs #30581 -- Added Q.flatten(). 2022-05-03 15:31:53 +02:00
Collin Anderson 3b898ea61e Fixed #29854 -- Made _all_related_fields() return deterministically ordered fields.
Thanks to Rick Yang and Baptiste Mispelon for the investigation.
2022-05-03 10:01:45 +02:00
Hrushikesh Vaidya f74d4cae6d
Fixed #33667 -- Used --header-branding-color for branding headers in admin. 2022-05-03 08:29:51 +02:00
Mariusz Felisiak 271a8e73ee Refs #33646 -- Made QuerySet.raw() async-compatible. 2022-05-02 10:52:33 +02:00
Mariusz Felisiak 77926176b2 Refs #33646 -- Added RawModelIterable. 2022-05-02 10:52:33 +02:00
David Wobrock aca9bb2a12 Fixed #33413 -- Made migrations propage collations to related fields. 2022-05-02 08:13:38 +02:00
Mariusz Felisiak 1b3a949ba2
Refs #33671 -- Fixed migrations crash when adding collation to a primary key on Oracle. 2022-04-29 21:43:55 +02:00
Clemens Wolff f0ba799edf
Refs #30426 -- Updated XFrameOptionsMiddleware docstring.
Follow up to 05d0eca635.
2022-04-29 21:17:27 +02:00
Mariusz Felisiak b34238addc
Fixed #33670 -- Fixed altering primary key on SQLite. 2022-04-29 20:16:34 +02:00
David Wobrock 87da283338 Refs #33413 -- Added collation to CharField/TextField's db_parameters. 2022-04-29 06:30:15 +02:00
mpachas aa28c392b9 Fixed #33661 -- Corrected Catalan date-format localization.
Changed DATE_FORMAT, DATETIME_FORMAT and MONTH_DAY_FORMAT
to use E placeholder (Month, locale specific alternative)
to handle both “de gener” and contracted “d’abril” cases.

Thanks to Ferran Jovell for review.
2022-04-28 15:12:15 +02:00
Carlton Gibson 476d4d5087 Refs #32339 -- Allowed renderer to specify default form and formset templates.
Co-authored-by: David Smith <smithdc@gmail.com>
2022-04-27 10:21:04 +02:00
Andrew Godwin 58b27e0dbb Fixed #33646 -- Added async-compatible interface to QuerySet.
Thanks Simon Charette for reviews.

Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-04-26 20:25:23 +02:00
Marcelo Galigniana 27aa7035f5 Fixed #27471 -- Made admin's filter choices collapsable. 2022-04-26 08:44:31 +02:00
L 37602e4948 Fixed #33656 -- Fixed MultiWidget crash when compressed value is a tuple. 2022-04-26 07:06:26 +02:00
marcperrinoptel 4282fd468f Fixed #33655 -- Removed unnecessary constant from GROUP BY clause for QuerySet.exists(). 2022-04-26 06:19:18 +02:00
siddhartha-star-dev dcebc5da48 Refs #2259 -- Disallowed primary keys in ModelAdmin.list_editable.
Refs #32728.
2022-04-25 11:00:50 +02:00
Hannes Ljungberg ed0a2c3238
Removed unnecessary variable in Index.create_sql().
Unnecessary since fdfb3086fc.
2022-04-22 19:07:56 +02:00
Collin Anderson 0de89b6f8d
Refs #31223 -- Added __class_getitem__() to ForeignKey. 2022-04-22 14:13:12 +02:00
Mariusz Felisiak eeb0bb6379
Refs #27674 --- Deprecated django.contrib.gis.admin.OpenLayersWidget. 2022-04-22 11:36:27 +02:00
Adam Johnson 6f453cd298 Fixed #33509 -- Added "(no-op)" to sqlmigrate output for operations without SQL statement. 2022-04-21 12:25:16 +02:00
sarahboyce cd4da34fc1 Fixed #33004 -- Made saving objects with unsaved GenericForeignKey raise ValueError.
This aligns to the behaviour of OneToOneField and ForeignKey fields.

Thanks Jonny Park for the initial patch.
2022-04-21 10:12:28 +02:00
Aymeric Augustin 5dfa6fca96 Refactored out RedirectURLMixin.get_success_url().
This also adds a default implementation of get_default_redirect_url().
2022-04-20 10:04:29 +02:00
Aymeric Augustin 04bc2564b6 Simplified LogoutView.get_success_url().
This preserves the behavior of redirecting to the logout URL without
query string parameters when an insecure ?next=... parameter is given.

It changes the behavior of a POST to the logout URL, as shown by the
test that is changed. Currently, this results in a GET to the logout
URL. However, such GET requests are deprecated. This change would be
necessary in Django 5.0 anyway. This commit merely anticipates it.
2022-04-20 10:04:29 +02:00
Aymeric Augustin 5fcd9b8c33 Unified LoginView/LogoutView.get_default_redirect_url() methods.
This might change the behavior when self.next_page == "". However,
resolve_url(self.next_page) would almost certainly fail in that case.

It is technically possible to define a logout URLpattern whose name is
"": path('logout/', LogoutView.as_view(), name=''), and then to refer to
this pattern with next_page = "". However this feels like a pathological
case, so we decided not to handle it.

Most checks on next_page, LOGIN_REDIRECT_URL, and LOGOUT_REDIRECT_URL
are performed with boolean evaluation rather than comparison with None.
That's why we standardizing that way.
2022-04-20 10:04:29 +02:00
Aymeric Augustin 5b8699e723 Renamed LogoutView.get_next_page() to get_success_url().
This aligns it with LoginView. Also, it removes confusion with the
get_next_page() method of paginators. get_next_page() was a private
API, therefore this refactoring is allowed.
2022-04-20 10:04:29 +02:00
Aymeric Augustin 12576bd371 Refactored out RedirectURLMixin.get_redirect_url().
This also renames SuccessURLAllowedHostsMixin to RedirectURLMixin.

This doesn't change the behavior of LogoutView.get_next_page() because
next_page == "" implies url_is_safe == False before the refactoring.
2022-04-20 10:04:29 +02:00
Andrey Otto 420d13edee
Fixed #33654 -- Added localdate to utils.timezone.__all__. 2022-04-20 09:59:48 +02:00
Carlton Gibson bf7c51a5f4 Fixed #33639 -- Enabled cached template loader in development. 2022-04-19 12:13:27 +02:00
Mariusz Felisiak f4f2afeb45
Refs #32226 -- Fixed JSON format of QuerySet.explain() on PostgreSQL when format is uppercased.
Follow up to aba9c2de66.
2022-04-19 08:24:24 +02:00
Aymeric Augustin 903702dfb1 Removed unnecessary default argument from GET.get() call in LoginView.get_redirect_url().
The default argument is unnecessary because
url_has_allowed_host_and_scheme() returns False when its first argument
is "" or None, so get_redirect_url() still returns "".

This also aligns LoginView.get_redirect_url() and LogoutView.get_next_page().
2022-04-19 06:25:38 +02:00
Aymeric Augustin 5591a72571
Fixed #33648 -- Prevented extra redirect in LogoutView on invalid next page when LOGOUT_REDIRECT_URL is set. 2022-04-18 16:33:10 +02:00
Mariusz Felisiak 331a460f8f Fixed DatabaseFeatures.uses_savepoints/can_release_savepoints and related tests with MyISAM storage engine. 2022-04-18 07:05:52 +02:00
Scott e12670016b
Fixed #33643 -- Fixed inspectdb crash on functional unique constraints on Oracle. 2022-04-16 15:29:51 +02:00
Alexandru Mărășteanu a1e4e86f92
Fixed #33607 -- Made PostgresIndex.create_sql() respect the "using" argument. 2022-04-15 22:00:28 +02:00
mgaligniana c72f6f36c1 Fixed #11803 -- Allowed admin select widgets to display new related objects.
Adjusted admin javascript to add newly created related objects to
already loaded select widgets.

In this version, applies only where limit_choices_to is not set.
2022-04-15 07:46:37 +02:00
Claude Paroz 08f30d1b6a
Fixed #33637 -- Improved initial zoom level in MapWidget. 2022-04-14 11:50:31 +02:00
Mariusz Felisiak a0bd006306
Made select_for_update() don't raise TransactionManagementError on databases that don't support transactions. 2022-04-14 07:53:15 +02:00
Tim Graham db83ac48d4 Expanded QuerySet.explain() error message if a backend supports no formats. 2022-04-14 06:46:42 +02:00
Tim Graham a32876606f Removed unneeded code in explain_query_prefix() 2022-04-14 06:46:42 +02:00
Florian Apolloner 2eea361eff Fixed #30511 -- Used identity columns instead of serials on PostgreSQL. 2022-04-13 21:51:51 +02:00
Mariusz Felisiak fdfb3086fc Fixed DatabaseFeatures.supports_index_column_ordering and related tests with MyISAM storage engine. 2022-04-13 11:56:24 +02:00
David Smith 856b528801
Removed unnecessary tuple call in SQLInsertCompiler. 2022-04-13 08:10:52 +02:00
Mariusz Felisiak 24f442b91d
Fixed DatabaseFeatures.supports_expression_indexes on MySQL with MyISAM. 2022-04-12 12:26:51 +02:00
mgaligniana 0ad5316f22 Fixed #24296 -- Made QuerySet.exists() clear selected columns for not sliced distinct querysets. 2022-04-12 08:18:22 +02:00
Himanshu-Balasamanta 06ebaa9e28 Fixed #33626 -- Cleared cache when unregistering a lookup. 2022-04-12 06:24:02 +02:00
Mateo Radman 884b4c27f5 Fixed #32604 -- Made file upload respect group id when uploading to a temporary file. 2022-04-11 13:32:27 +02:00
Mariusz Felisiak b8759093d8
Removed DatabaseFeatures.validates_explain_options.
Always True since 6723a26e59.
2022-04-11 12:58:01 +02:00
Mariusz Felisiak 6723a26e59 Fixed CVE-2022-28347 -- Protected QuerySet.explain(**options) against SQL injection on PostgreSQL. 2022-04-11 08:59:58 +02:00
Mariusz Felisiak 93cae5cb2f Fixed CVE-2022-28346 -- Protected QuerySet.annotate(), aggregate(), and extra() against SQL injection in column aliases.
Thanks Splunk team: Preston Elder, Jacob Davis, Jacob Moore,
Matt Hanson, David Briggs, and a security researcher: Danylo Dmytriiev
(DDV_UA) for the report.
2022-04-11 08:59:33 +02:00
Manel Clos 62739b6e26 Fixed #33628 -- Ignored directories with empty names in autoreloader check for template changes.
Regression in 68357b2ca9.
2022-04-11 07:37:30 +02:00
Simon Charette 0b31e02487 Fixed #33618 -- Fixed MTI updates outside of primary key chain. 2022-04-07 07:54:56 +02:00
Carlton Gibson 9ffd4eae2c
Fixed #33611 -- Allowed View subclasses to define async method handlers. 2022-04-07 07:05:59 +02:00
sarahboyce 65effbdb10 Fixed #33471 -- Made AlterField operation a noop when changing "choices".
This also allows customizing attributes of fields that don't affect
a column definition.
2022-04-06 13:05:57 +02:00
David Smith 6991880109 Refs #31617 -- Added an id for helptext in admin forms. 2022-04-06 12:42:43 +02:00
Baptiste Mispelon 50e1e7ef8e Fixed #33348 -- Changed SimpleTestCase.assertFormError()/assertFormsetErrors() to take form/formset.
Instead of taking a response object and a context name for
the form/formset, the two methods now take the object directly.
2022-04-06 07:58:52 +02:00
Brian Helba 2d5215c675 Fixed #33605 -- Fixed migration crash when altering RegexValidator to pre-compiled regular expression. 2022-04-04 07:38:15 +02:00
Lucidiot 13a9cde133 Fixed #33613 -- Made createsuperuser detect uniqueness of USERNAME_FIELD when using Meta.constraints. 2022-04-01 11:39:41 +02:00
Luke Plant 40b8a6174f Fixed #33397 -- Corrected resolving output_field for DateField/DateTimeField/TimeField/DurationFields.
This includes refactoring of CombinedExpression._resolve_output_field()
so it no longer uses the behavior inherited from Expression of guessing
same output type if argument types match, and instead we explicitly
define the output type of all supported operations.

This also makes nonsensical operations involving dates
(e.g. date + date) raise a FieldError, and adds support for
automatically inferring output_field for cases such as:
* date - date
* date + duration
* date - duration
* time + duration
* time - time
2022-03-31 11:05:23 +02:00
Luke Plant 1efea11808 Refs #33397 -- Added register_combinable_fields(). 2022-03-31 11:02:46 +02:00
Mariusz Felisiak d7eb500338 Removed unnecessary Query.get_loaded_field_names_cb() and Query.deferred_to_data()'s callback argument. 2022-03-31 10:54:59 +02:00
Mariusz Felisiak 0a3c6fe6b2 Refs #24020 -- Removed redundant Query.get_loaded_field_names().
get_loaded_field_names() is no longer called in multiple places
(see 0c7633178f) and it's redundant
with SQLCompiler.deferred_to_columns().
2022-03-31 10:54:59 +02:00
Mariusz Felisiak 0db0a25d84
Updated select_related_descend() comment.
Outdated since 0c7633178f.
2022-03-31 08:50:25 +02:00
David c8459708a7 Refs #32339 -- Added use_fieldset to Widget. 2022-03-30 16:28:14 +02:00
Mariusz Felisiak fac662f479
Fixed #33598 -- Reverted "Removed unnecessary reuse_with_filtered_relation argument from Query methods."
Thanks lind-marcus for the report.

This reverts commit 0c71e0f9cf.

Regression in 0c71e0f9cf.
2022-03-30 07:31:56 +02:00
Carlton Gibson 59ab3fd0e9 Refs #32365 -- Deprecated django.utils.timezone.utc. 2022-03-29 14:47:44 +02:00
Alokik Vijay baf9604ed8 Fixed #16406 -- Added ResolveMatch.captured_kwargs and extra_kwargs.
Thanks Florian Apolloner for the review and implementation idea.
2022-03-29 10:27:40 +02:00
Mariusz Felisiak 83c803f161
Updated Oracle docs links to Oracle 21c. 2022-03-29 09:41:57 +02:00
René Fleschenberg eb07b5be0c Fixed #15619 -- Deprecated log out via GET requests.
Thanks Florian Apolloner for the implementation idea.

Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-03-29 06:42:14 +02:00
adontz 2bee0b4328 Fixed #7497 -- Allowed overriding the order of apps and models in admin. 2022-03-25 10:33:44 +01:00
Mariusz Felisiak 94d8ed55fa
Refs #15619 -- Logged out with POST requests in admin. 2022-03-24 17:41:53 +01:00
Carlton Gibson bb61f0186d Refs #32365 -- Removed internal uses of utils.timezone.utc alias.
Remaining test case ensures that uses of the alias are mapped
canonically by the migration writer.
2022-03-24 06:29:50 +01:00
Thomas Schmidt 1cf60ce601 Fixed #33569 -- Added SECURE_PROXY_SSL_HEADER support for list of protocols in the header value. 2022-03-23 19:33:36 +01:00
Carlton Gibson d46e158ee2 Refs #32365 -- Made migration writer use datetime.timezone.utc. 2022-03-23 12:43:43 +01:00
Gagaro 7325d29152 Refs #30581 -- Fixed DatabaseFeatures.bare_select_suffix on MySQL < 8 and MariaDB < 10.4. 2022-03-22 09:45:59 +01:00
Stefan Wehrmeyer 561761c660 Fixed #33592 -- Fixed "View on Site" links in custom admin site. 2022-03-21 10:07:32 +01:00
François Granade 4b8e4f5060 Fixed #33582 -- Fixed deserializing natural keys with foreing key dependencies in a multiple database setup. 2022-03-18 20:57:08 +01:00
David Smith ba298a32b3 Refs #31169 -- Prevented infinite loop in parallel tests with custom test runner when using spawn.
Regression in 3b3f38b3b0.

Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-03-17 10:20:13 +01:00
Florian Apolloner 4f92cf87b0 Prevented initialization of unused database connections. 2022-03-17 07:40:57 +01:00
Florian Apolloner 13378ad952 Moved ensure_defaults() and prepare_test_settings() logic to ConnectionHandler.configure_settings(). 2022-03-17 07:36:34 +01:00
Florian Apolloner 58ad9a99a7 Removed usage of django.db.utils.ConnectionHandler.databases. 2022-03-17 07:36:34 +01:00