0
0
mirror of https://github.com/django/django.git synced 2024-11-25 07:59:34 +01:00
Commit Graph

32582 Commits

Author SHA1 Message Date
jmcfee
d21dc2ed7e added comment and updated unit test 2024-05-31 01:03:53 -04:00
jmcfee
a2e3eed53e Fixed #35402 -- Fixed crash when DatabaseFeatures.django_test_skips references a class in another test module
Previously, if a submodule skipped test classes in an adjacent submodule (same
parent module), only the running submodule was imported and an error was thrown
because getattr would not find the submodule of the to-be-skipped class. Updated
cached_import in django/utils/module_loading.py to include a check for the skipped
submodule, and import it if it is not there.

Thanks to Tim Graham for reporting this bug
2024-04-26 16:30:20 -04:00
Simon Charette
195d885ca0 Refs #35356 -- Clarified select related with masked field logic.
By always including related objects in the select mask via adjusting the
defer logic (_get_defer_select_mask()), it becomes possible for
select_related_descend() to treat forward and reverse relationships
indistinctively.

This work also simplifies and adds comments to
select_related_descend() to make it easier to understand.
2024-04-23 13:17:17 -03:00
Simon Charette
83f5478225 Fixed #35356 -- Deferred self-referential foreign key fields adequately.
While refs #34612 surfaced issues with reverse one-to-one fields
deferrals, it missed that switching to storing remote fields would break
self-referential relationships.

This change switches to storing related objects in the select mask
instead of remote fields to prevent collisions when dealing with
self-referential relationships that might have a different directional
mask.

Despite fixing #21204 introduced a crash under some self-referential
deferral conditions, it was simply not working even before that as it
aggregated the sets of deferred fields by model.

Thanks Joshua van Besouw for the report and Mariusz Felisiak for the
review.
2024-04-23 13:17:17 -03:00
minusf
bcad5ad92b
Fixed incorrect blockquotes in docs/topics/forms/index.txt. 2024-04-22 22:26:55 -03:00
James Ostrander
36b7024b7f Fixed #35392, Refs #34331 -- Allowed importing aprefetch_related_objects from django.db.models.
Thanks James Ostrander for the report and fix, and to Tim Graham and
Mariusz Felisiak for the reviews.
2024-04-22 17:05:05 -03:00
Jkhall81
53719d6b5b Fixed #35321 -- Prevented Mobile Safari zoom-in on Django admin inputs.
Thanks Simon Willison for the report and Ben Cardy for testing.
2024-04-19 14:36:37 +02:00
Sarah Boyce
45f530ffc4 Reverted release notes for bdd76c4c38. 2024-04-19 14:04:38 +02:00
Adam Johnson
bdd76c4c38 Fixed #34994, Fixed #35386 -- Applied checkbox-row CSS class unconditionally in Admin. 2024-04-19 11:20:01 +02:00
Marijke Luttekes
2be37b2533 Made SeleniumTests.test_inline_add_another_widgets less flaky by adding explicit wait. 2024-04-17 17:38:04 +02:00
David Sanders
f0d50a9379
Doc'd that RemoveField also drops related database objects in PostgreSQL. 2024-04-16 13:11:06 -03:00
Simon Charette
d048f0d311 Fixed #35373 -- Fixed a crash when indexing a generated field on SQLite.
Generated fields have to be excluded from the INSERT query against the remade
table including the index.

Thanks Moshe Dicker for the report, David Sanders and Mariusz Felisiak for the
review.
2024-04-16 17:27:38 +02:00
Mohammad Kazemi
47c608202a
Extended docs for Q() objects mentioning the ~ (NOT) operator.
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2024-04-15 13:16:35 -03:00
Eyal Cherevatsky
2bcf555763 Fixed #35375 -- Fixed tabular inline admin original line to be on the right in RTL. 2024-04-15 16:11:57 +02:00
Mariusz Felisiak
dd23821208 Fixed backends.oracle.tests.TransactionalTests.test_hidden_no_data_found_exception() on oracledb >= 2.1.2.
python-oracledb 2.1.2+ no longer hides 'ORA-1403: no data found'
exceptions raised in database triggers:

https://github.com/oracle/python-oracledb/issues/321
2024-04-15 09:01:53 +02:00
nessita
42bc81b1b6
Corrected alphabetical order of latest author added to AUTHORS. 2024-04-12 12:15:28 -03:00
Natalia
cd823778e6 Refs #35361 -- Clarified release notes for 4.2.12 and 5.0.5. 2024-04-12 14:40:14 +02:00
Adam Johnson
50a702f3fd Fixed #35364 -- Stopped AdminEmailHandler rendering email unnecessarily. 2024-04-12 10:37:28 +02:00
Adam Johnson
b0f2289426 Refs #35364 -- Tested AdminEmailHandler with empty ADMINS. 2024-04-12 10:37:28 +02:00
Simon Charette
73b62a2126 Refs #35194 -- Adjusted a generated field test to work on Postgres 15.6+.
Postgres >= 12.18, 13.14, 14.11, 15.6, 16.2 changed the way the immutability
of generated and default expressions is detected in postgres/postgres@743ddaf.

The adjusted test semantic is presereved by switching from __icontains to
__contains as both make use of a `%` literal which requires proper escaping.

Refs #35336.

Thanks bcail for the report.
2024-04-12 10:23:04 +02:00
Aleksander Milinkevich
c223d14025
Corrected description of list_display being a list in tutorial 7. 2024-04-11 18:00:17 -03:00
Adam Johnson
8bbf73ca74
Fixed settings path in docs for installing SpatiaLite with Homebrew.
Co-authored-by: Adam Zapletal <adamzap@gmail.com>
2024-04-10 18:15:42 -03:00
nessita
e359f05b49
Updated docs for updating translations in docs/internals/howto-release-django.txt.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-04-10 18:13:59 -03:00
Sarah Boyce
f973a70bfc
Made postgresql.tests.Tests.test_connect_pool less flaky by increasing timeout value. 2024-04-10 14:09:52 -03:00
Natalia
42435fc55c Fixed #35361 -- Added release notes for 4.2.12 and 5.0.5 for backport of b231bcd19e. 2024-04-10 17:56:55 +02:00
Natalia
338ec052b4 Refs #35361 -- Added test for Email line length checks when dealing with surrogate pairs.
Refs #33173, #34118 and #34900.
2024-04-10 17:56:55 +02:00
Sarah Boyce
8b53560eea Fixed #35350 -- Fixed save() with pk set on models with GeneratedFields.
Thanks Matt Hegarty for the report and Simon Charette and Natalia Bidart for the reviews.

Regression in f333e35.
2024-04-10 15:43:50 +02:00
Carlton Gibson
ca5cd3e3e8 Refs #35354 -- Clarified FORCE_SCRIPT_NAME docs. 2024-04-05 15:13:54 +02:00
Carlton Gibson
bcd255cd5c Fixed #35354 -- Simplified ASGIRequest path handling.
Following the ASGI HTTP Connection Scope docs[0], the provided `path`
is already the correct value that Django requires.

In combination with `root_path`, from which `script_name` is derived,
the `path_info` variable is set. It's then redundant to
re-calculate `path` from `script_name` and `path_info`.

See also, a clarifying discussion on the ASGIref repo[1].

[0]: https://asgi.readthedocs.io/en/latest/specs/www.html#http-connection-scope
[1]: https://github.com/django/asgiref/issues/424
2024-04-05 11:35:38 +02:00
Carlton Gibson
4d2ef9bb82 Refs #35169 -- Added test for ASGIRequest root_path handling. 2024-04-05 11:30:33 +02:00
Adam Johnson
ba4ffdc877
Refs #31710 -- Improved multiple file upload docs. 2024-04-04 19:18:36 -03:00
Lang Tran
e279c724c1
Fixed #35347 -- Clarified choice_set attribute in tutorial 2. 2024-04-04 16:05:18 -03:00
Natalia
4636baec17 Added stub release notes for 5.0.5. 2024-04-03 12:21:28 -03:00
Natalia
81da153e5f Added release date for 5.0.4. 2024-04-03 11:12:03 -03:00
Sarah Boyce
89403dbedd Fixed SeleniumTests.test_related_object_update_with_camel_casing() assert.
A selenium web element was compared to a string rather than its innerHTML.
2024-04-03 09:29:01 +02:00
devin13cox
8665cf03d7
Fixed #35330 -- Fixed the update of related widgets when the referenced model is camel case named.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-04-02 22:00:25 -03:00
Simon Charette
888b9042b3
Fixed #35336 -- Addressed crash when adding a GeneratedField with % literals.
A longer term solution is likely to have a better separation of parametrized
DDL altogether to handle checks, constraints, defaults, and generated fields
but such a change would require a significant refactor that isn't suitable
for a backport.

Thanks Adrian Garcia for the report.
2024-04-02 17:33:31 -03:00
Johannes Westphal
5f18021640 Fixed #35344, Refs #34838 -- Corrected output_field of resolved columns for GeneratedFields in aliased tables.
Thanks Simon Charette for the review.
2024-04-01 18:54:38 +01:00
Mariusz Felisiak
425b26092f
Refs #35234 -- Skipped CheckConstraint system checks if not supported.
Thanks Tim Graham for the report.

Regression in 0fb104dda2.
2024-03-30 14:15:03 +01:00
Taishi Endo
0df520979a
Restored django.db.models.F import in final code snippet added at the beginning of tutorial 4. 2024-03-29 12:33:08 -03:00
Matthias Kestenholz
5f3cdf219d
Fixed typo in docs/topics/signals.txt. 2024-03-28 13:45:04 -03:00
Fabian Braun
944745afe2 Fixed #34977 -- Improved accessibility in the UserChangeForm by replacing the reset password link with a button.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-03-27 16:40:41 -03:00
Giannis Terzopoulos
d658a3162f Fixed #35233 -- Moved template engine system checks to backend methods.
Thanks Adam Johnson for reviews.
2024-03-27 08:14:54 +01:00
Mariusz Felisiak
b98271a6e4
Fixed #35329 -- Fixed migrations crash when adding partial unique constraints with nulls_distinct.
Bug in 595a2abb58.

Thanks Lucas Lemke Saunitti for the report.
2024-03-26 22:58:47 +01:00
Mariusz Felisiak
ae10146793
Removed unused _alter_column_collation_sql() in PostgreSQL DatabaseSchemaEditor.
Unused since ae0899be0d.
2024-03-25 08:50:26 +01:00
Mariusz Felisiak
a2dcc4ecbb
Increased test coverage for django.db.migrations.operations.special. 2024-03-25 08:31:32 +01:00
Ben Cail
07c8d979ae Fixed #35323 -- Prevented file_move_safe() from trying to overwrite existing file when allow_overwrite is False. 2024-03-24 16:05:36 +01:00
David Sanders
b6e2b83901 Fixed #34841 -- Avoided rendering apps on state still requiring mutation. 2024-03-22 21:29:59 +01:00
Mariusz Felisiak
1c11dba835
Added ModelState.from_model() test for abstract model with unnamed indexes. 2024-03-22 13:31:33 +01:00
Ben Cail
8dbfef4695 Fixed #35320 -- Removed unnecessary django.core.files.move._samefile() hook.
os.path.samefile() uses the same implementation on Windows as all other
platforms since Python 3.4.
2024-03-21 20:15:41 +01:00