Commit Graph

12574 Commits

Author SHA1 Message Date
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 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 8e89dfe1c2 Fixed various tests on MySQL with MyISAM storage engine. 2022-04-18 07:05:52 +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
Mariusz Felisiak 1760ad4e8c
Relaxed some query ordering assertions in various tests.
It accounts for differences seen on MySQL with MyISAM storage engine.
2022-04-14 12:12:13 +02:00
Carlton Gibson 5c67d906fd Removed stale Windows asyncio test skips.
Underlying issue was fixed in Python 3.8.1, now many versions ago.
https://bugs.python.org/issue38563
2022-04-14 10:43:34 +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
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
Mariusz Felisiak 1bdfde0857 Fixed typo in SchemaIndexesMySQLTests.test_no_index_for_foreignkey(). 2022-04-13 11:56:24 +02:00
Mariusz Felisiak a65547c04a
Fixed tests on databases that don't support introspecting foreign keys. 2022-04-13 11:52:40 +02:00
Mariusz Felisiak 0b63124c84
Improved ExplainTests.test_basic().
QuerySet.select_for_update() is not supported by all databases.
Moreover it cannot be used outside of a transaction.
2022-04-13 10:17:14 +02:00
SanderBeekhuis 27d52158b2
Fixed #33627 -- Improved nonexistent pk in ModelMultipleChoiceFieldTests.test_model_multiple_choice_field(). 2022-04-13 08:31:23 +02:00
zhangyangyu 1bb9bd9724 Fixed #33633 -- Skipped some test_utils tests on databases that don't support transactions. 2022-04-12 13:37:44 +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
mgaligniana d2263b7b87 Refs #18414 -- Added tests for selected columns of 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
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
Mariusz Felisiak 2ee4caf56b
Refs #33173 -- Fixed test_runner/test_utils tests on Python 3.11+.
Python 3.11 uses fully qualified test name in unittest output. See
755be9b150
2022-04-07 07:02:21 +02:00
Mariusz Felisiak bfe9665502
Skipped SchemaTests.test_alter_field_type_and_db_collation on databases that don't support collation on TextField. 2022-04-06 16:52:13 +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
Mariusz Felisiak 1a7d75cf77
Moved remaining SimpleTestCase.assertFormError()/assertFormsetErrors() tests to test_utils.
This also removes redundant tests in test_client_regress.

Follow up to 68144f4049.
2022-04-05 08:37:28 +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
David c8459708a7 Refs #32339 -- Added use_fieldset to Widget. 2022-03-30 16:28:14 +02:00
Luke Plant 04ad0f26ba Refs #33397 -- Added extra tests for resolving an output_field of CombinedExpression. 2022-03-30 11:03:48 +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
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
Mariusz Felisiak abfdb4d7f3
Reverted "Fixed forms_tests.tests.test_renderers with Jinja 3.1.0+."
This reverts commit 1d9d082acf.
2022-03-26 12:27:30 +01: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 d44951b36e Refs #7497 -- Added assertion for the default order of models in AdminSite.app_index(). 2022-03-25 10:29:59 +01:00
Mariusz Felisiak 1d9d082acf
Fixed forms_tests.tests.test_renderers with Jinja 3.1.0+.
See https://github.com/pallets/jinja/pull/1621.
2022-03-25 08:48:32 +01:00
Mariusz Felisiak 94d8ed55fa
Refs #15619 -- Logged out with POST requests in admin. 2022-03-24 17:41:53 +01:00
Mariusz Felisiak 1b695fbbc2
Refs #33577 -- Used addCleanup() to remove .aux file in GDALBandTests.
Follow up to 970f5bf503.
2022-03-24 09:13:24 +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
likecodingloveproblems 4b66a5e617 Fixed #33256 -- Fixed schema test failures when using --keepdb. 2022-03-21 20:54:48 +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
Mariusz Felisiak ed6db53542 Fixed isolation of FeaturesTests.test_supports_json_field_operational_error(). 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
Gagaro bf524d229f Refs #30581 -- Allowed sql.Query to be used without model. 2022-03-16 09:33:16 +01:00
Mariusz Felisiak 970f5bf503
Fixed #33577 -- Confirmed support for GDAL 3.4. 2022-03-16 09:07:01 +01:00
David Smith 3b3f38b3b0 Fixed #31169 -- Adapted the parallel test runner to use spawn.
Co-authored-by: Valz <ahmadahussein0@gmail.com>
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2022-03-15 16:23:55 +01:00
Sage Abdullah a88fab1bca Fixed #33552 -- Fixed JSONField has key lookups with numeric keys on MariaDB, MySQL, Oracle, and SQLite. 2022-03-15 06:37:35 +01:00
Biel Frontera 859a87d873 Fixed #31357 -- Fixed get_for_models() crash for stale content types when model with the same name exists in another app. 2022-03-14 12:52:26 +01:00
Adam Johnson 8f7cda0831
Fixed #33572 -- Implemented CreateModel/AlterModelManagers reduction. 2022-03-11 07:03:51 +01:00
Collin Anderson 71017a68a6
Fixed #33571 -- Fixed static serving views crash when If-Modified-Since is empty.
Regression in d6aff369ad.
2022-03-11 06:19:01 +01:00
Adrian Torres d90e34c61b Fixed #33561 -- Allowed synchronization of user attributes in RemoteUserBackend. 2022-03-10 12:57:19 +01:00
Claude Paroz 93803a1b5f Fixed #33567 -- Avoided setting default text/html content type on responses. 2022-03-09 14:50:52 +01:00
Adam Johnson a45f28f0ec Rewrote strip_tags test file to lorem ipsum. 2022-03-08 14:50:06 +01:00
Adam Johnson a8c15481f4 Rewrote some references to "master".
Following d9a266d657.
2022-03-08 14:50:06 +01:00
Mariusz Felisiak d4fd31684a
Refs #33173 -- Used locale.getlocale() instead of getdefaultlocale().
locale.getdefaultlocale() was deprecated in Python 3.11, see
https://bugs.python.org/issue46659.
2022-03-08 13:17:05 +01:00
Hameed Gifford 58d357fc65
Fixed #33563 -- Fixed contenttype reverse data migration crash with a multiple databases setup. 2022-03-08 06:22:03 +01:00
Luke Plant f3bf6c4218 Refs #33562 -- Made HttpResponse.set_cookie() raise ValueError when both "expires" and "max_age" are passed.
This fixes the case where you might pass set_cookie(expires=val, max_age=val)
and max_age is silently ignored.
2022-03-07 08:04:18 +01:00
Luke Plant ae2da5ba65 Fixed #33562 -- Made HttpResponse.set_cookie() support timedelta for the max_age argument. 2022-03-07 07:57:14 +01:00
Luke Plant 1882f6567d Refs #33562 -- Added tests HttpRequest.get_signed_cookie() with timedeltas. 2022-03-07 07:29:43 +01:00
Ryan Heard c6b4d62fa2 Fixed #29865 -- Added logical XOR support for Q() and querysets. 2022-03-04 12:55:37 +01:00
Mariusz Felisiak a46bc327e7
Refs #11293 -- Added test for filtering aggregates with negated & operator. 2022-03-04 09:51:52 +01:00
Adam Johnson b811364421 Refs #33446 -- Allowed variable whitespace in CSS source map references.
Follow up to dc8bb35e39.

The Webpack default is to output CSS source map comments like
`/*# sourceMappingURL=main.css.map*/`. Also, Chromium allows tabs.
2022-03-04 06:22:28 +01:00
Keryn Knight 9bde906fb2 Refs #10188 -- Added tests for BadHeaderErrors when HTTP header with newlines cannot be encoded/decoded. 2022-03-02 20:23:39 +01:00
Mariusz Felisiak 445b075def
Fixed #33547 -- Fixed error when rendering invalid inlines with readonly fields in admin.
Regression in de95c82667.

Thanks David Glenck for the report.
2022-03-01 08:09:58 +01:00
Hrushikesh Vaidya 119f227aa6 Fixed #33524 -- Allowed overriding empty_label for ForeignKey in ModelAdmin.radio_fields. 2022-02-28 13:28:21 +01:00
Mariusz Felisiak 26c166c3b0
Added test for removing through model from ManyToManyField. 2022-02-25 22:01:27 +01:00
Albert Defler 2b6a3baebe Fixed #31486 -- Deprecated passing unsaved objects to related filters.
Co-Authored-By: Hasan Ramezani <hasan.r67@gmail.com>
2022-02-25 07:51:37 +01:00
Shubh1815 11cc227344 Fixed #33267 -- Added link to related item to related widget wrapper in admin. 2022-02-25 06:33:05 +01:00
Albert Defler 18245b948b Refs #7488, Refs #19524 -- Removed obsolete ModelInheritanceTest.test_issue_7488() test.
Obsolete since e9c24bef74.
2022-02-24 09:55:02 +01:00
Anders Kaseorg 7f4fc5cbd4 Fixed #33539 -- Fixed spaces in WITH SQL for indexes on PostgreSQL. 2022-02-24 09:03:58 +01:00
mgaligniana fe7dbef586 Fixed #28889 -- Prevented double submission of admin forms.
Added a JavaScript confirm() to catch double-submissions, when the
change form has already been submitted.

Thanks to Adam Johnson, Claude Paroz, Keryn Knight, and Thibaud Colas
for review.
2022-02-23 14:57:34 +01:00
Mariusz Felisiak d11944be34
Refs #33476 -- Added warning to optimizemigration/squashmigrations commands when black cannot be applied. 2022-02-23 07:29:15 +01:00
David Wobrock 7c318a8bdd Fixed #27844 -- Added optimizemigration management command. 2022-02-22 10:30:40 +01:00
Nick Pope 847f46e9bf
Removed redundant QuerySet.all() calls in docs and tests.
Most QuerySet methods are mapped onto the Manager and, in general,
it isn't necessary to call .all() on the manager.
2022-02-22 10:29:38 +01:00
Albert Defler 7ba6ebe914 Fixed #19580 -- Unified behavior of reverse foreign key and many-to-many relations for unsaved instances. 2022-02-22 09:16:40 +01:00
nabil-rady b7f263551c Refs #33517 -- Prevented __second lookup from returning fractional seconds on PostgreSQL. 2022-02-22 07:26:44 +01:00
Theo Alexiou 659d2421c7 Fixed #20296 -- Prevented mark_safe() from evaluating lazy objects. 2022-02-21 10:11:26 +01:00
Mariusz Felisiak 1299bc33e1
Refs #33526 -- Made CSRF_COOKIE_SECURE/SESSION_COOKIE_SECURE/SESSION_COOKIE_HTTPONLY don't pass on truthy values. 2022-02-21 07:54:47 +01:00
saeedblanchette e559070a7a Fixed #33518 -- Added RemovedAfterNextVersionWarning. 2022-02-21 06:23:41 +01:00
David Smith fac3dd7f39
Refs #33173 -- Fixed MailTests.test_backend_arg() on Windows and Python 3.11+. 2022-02-19 20:36:01 +01:00
Hasan Ramezani 9ac3ef59f9 Fixed #33379 -- Added minimum database version checks.
Thanks Tim Graham for the review.
2022-02-18 13:37:49 +01:00
My-Name-Is-Nabil 3079133c73 Fixed #33514 -- Added fallbacks to subsequent language codes in Select2 translations. 2022-02-18 08:34:49 +01:00
Matthias Kestenholz b2ed0d78f2 Refs #28358 -- Fixed infinite recursion in LazyObject.__getattribute__().
Regression in 97d7990abd.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Theo Alexiou <theofilosalexiou@gmail.com>
2022-02-17 14:52:17 +01:00
Mariusz Felisiak 1e2e1be02b
Fixed #33515 -- Prevented recreation of migration for ManyToManyField to lowercased swappable setting.
Thanks Chris Lee for the report.

Regression in 4328970780.

Refs #23916.
2022-02-16 21:09:24 +01:00
Theo Alexiou 97d7990abd Fixed #28358 -- Prevented LazyObject from mimicking nonexistent attributes.
Thanks Sergey Fedoseev for the initial patch.
2022-02-16 10:51:15 +01:00
Carlton Gibson 236e6cb588 Refs #31407 -- Handled potential exception in test cleanup.
The test view may not be called when running the tests with
--parallel=2 or greater. Catch the AttributeError for this case.
2022-02-15 14:38:19 +01:00
Baptiste Mispelon f7e0bffa2e Refs #33348 -- Made SimpleTestCase.assertFormError() raise ValueError when "field" is passed without "form_index". 2022-02-15 10:30:20 +01:00
Mariusz Felisiak d4c9dab74b Refs #33348 -- Fixed SimpleTestCase.assertFormError() error message raised for unbound forms. 2022-02-15 10:16:06 +01:00
Baptiste Mispelon d84cd91e90 Refs #33348 -- Improved messages raised by SimpleTestCase.assertFormError()/assertFormsetErrors().
This makes messages use BaseFormSet/BaseForm.__repr__() instead of
context, and adds the _assert_form_error() helper.
2022-02-15 07:15:44 +01:00
Baptiste Mispelon 9bb13def5d Refs #33348 -- Made SimpleTestCase.assertFormsetErrors() raise an error when form_index is too big. 2022-02-14 12:46:46 +01:00
Baptiste Mispelon 261885e4c1 Simplified SimpleTestCase.assertFormError()/assertFormsetErrors() calls in admin_views tests. 2022-02-14 11:34:58 +01:00
Baptiste Mispelon 1f749d6f12 Fixed field name in admin_views.tests.UserAdminTest.test_password_mismatch() assertion. 2022-02-14 11:29:45 +01:00
Baptiste Mispelon 7986028e3f Refs #33348 -- Made SimpleTestCase.assertFormError()/assertFormsetErrors() raise an error for unbound forms/formsets. 2022-02-14 08:43:46 +01:00
rafrafek cdd4ff67d2 Refs #25684 -- Removed double newline from request/response output of runserver.
Follow up to 0bc5cd6280.
2022-02-14 06:55:34 +01:00
Mariusz Felisiak 3702819227
Refs #32502 -- Avoided table rebuild when removing fields on SQLite 3.35.5+.
ALTER TABLE ... DROP COLUMN was introduced in SQLite 3.35+ however
a data corruption issue was fixed in SQLite 3.35.5.
2022-02-11 22:21:58 +01:00
Carlton Gibson d113b5a837 Refs #33476 -- Made management commands use black.
Run black on generated files, if it is available on PATH.
2022-02-11 12:23:26 +01:00
Theo Alexiou f9ec777a82 Fixed #26287 -- Added support for addition operations to SimpleLazyObject. 2022-02-10 11:24:51 +01:00
Claude Paroz 4c76ffc2d6 Fixed #29490 -- Added support for object-based Media CSS and JS paths. 2022-02-10 08:48:27 +01:00
Damian Posener 09e499a39e Fixed #33501 -- Made order_with_respect_to respect database routers. 2022-02-09 13:31:49 +01:00
Aaron Chong 2d472ad05c Fixed #33495 -- Improved debug logging message about adapting handlers for middlewares.
It's the wrapped handler that's adapted to the wrapping middleware.
2022-02-09 12:10:26 +01:00
Simon Charette d35ce682e3 Fixed #33506 -- Made QuerySet.bulk_update() perform atomic writes against write database.
The lack of _for_write = True assignment in bulk_update prior to
accessing self.db resulted in the db_for_read database being used to
wrap batched UPDATEs in a transaction.

Also tweaked the batch queryset creation to also ensure they are
executed against the same database as the opened transaction under all
circumstances.

Refs #23646, #33501.
2022-02-09 11:14:50 +01:00
Mariusz Felisiak 7119f40c98 Refs #33476 -- Refactored code to strictly match 88 characters line length. 2022-02-07 20:37:05 +01:00
django-bot 9c19aff7c7 Refs #33476 -- Reformatted code with Black. 2022-02-07 20:37:05 +01:00
Mariusz Felisiak f68fa8b45d Refs #33476 -- Changed quotation marks in DebugViewTests.test_template_exceptions().
This prevents a failure after reformatting the code with Black.
2022-02-07 20:36:04 +01:00
Mariusz Felisiak 6f185a53a2
Refs #33482 -- Fixed QuerySet selecting and filtering againts negated Exists() with empty queryset.
Regression in b7d1da5a62.
2022-02-07 20:34:21 +01:00
Carlton Gibson 4b8e9492d9 Refs #32559 -- Added selenium test for FloatField client-side validation.
step="any" is required for non-integer values. See:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number#step

Covers behaviour added in 7ec2a21be1.
2022-02-03 13:50:37 +01:00
Hrushikesh Vaidya 832adb31f2 Fixed #33473 -- Fixed detecting changes by autoreloader in .py files inside template directories. 2022-02-03 11:22:45 +01:00
Mariusz Felisiak c5cd878382
Refs #33476 -- Refactored problematic code before reformatting by Black.
In these cases Black produces unexpected results, e.g.

def make_random_password(
    self,
    length=10,
    allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789',
):

or

cursor.execute("""
SELECT ...
""",
    [table name],
)
2022-02-03 11:20:46 +01:00
Simon Charette b7d1da5a62 Fixed #33482 -- Fixed QuerySet filtering againts negated Exists() with empty queryset.
Thanks Tobias Bengfort for the report.
2022-02-02 07:54:19 +01:00
tschilling 0dcd549bbe Fixed #30360 -- Added support for secret key rotation.
Thanks Florian Apolloner for the implementation idea.

Co-authored-by: Andreas Pelme <andreas@pelme.se>
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
Co-authored-by: Vuyisile Ndlovu <terrameijar@gmail.com>
2022-02-01 11:12:24 +01:00
Mariusz Felisiak fc18f36c4a Fixed CVE-2022-23833 -- Fixed DoS possiblity in file uploads.
Thanks Alan Ryan for the report and initial patch.
2022-02-01 07:41:40 +01:00
Markus Holtermann 394517f078 Fixed CVE-2022-22818 -- Fixed possible XSS via {% debug %} template tag.
Thanks Keryn Knight for the report.

Co-authored-by: Adam Johnson <me@adamj.eu>
2022-02-01 07:40:51 +01:00
Kirill Safronov 97a7274468 Fixed #33480 -- Fixed makemigrations crash when renaming field of renamed model.
Regression in aa4acc164d.
2022-02-01 07:01:41 +01:00
Mariusz Felisiak 71e7c8e737
Fixed #33468 -- Fixed QuerySet.aggregate() after annotate() crash on aggregates with default.
Thanks Adam Johnson for the report.
2022-01-31 11:33:24 +01:00
Keryn Knight 55022f75c1 Fixed #33465 -- Added empty __slots__ to SafeString and SafeData.
Despite inheriting from the str type, every SafeString instance gains
an empty __dict__ due to the normal, expected behaviour of type
subclassing in Python.

Adding __slots__ to SafeData is necessary, because otherwise inheriting
from that (as SafeString does) will give it a __dict__ and negate the
benefit added by modifying SafeString.
2022-01-29 13:50:34 +01:00
Keryn Knight c5c7a15b09 Fixed #33461 -- Escaped template errors in the technical 500 debug page. 2022-01-28 07:07:12 +01:00
vgolubev e87f57fdb8 Fixed #26142 -- Allowed model formsets to prevent new object creation.
Thanks Jacob Walls, David Smith, and Mariusz Felisiak for reviews.

Co-authored-by: parth <parthvin@gmail.com>
2022-01-27 20:45:21 +01:00
Jörg Breitbart 0af9a5fc7d Fixed #33463 -- Fixed QuerySet.bulk_update() with F() expressions. 2022-01-27 19:03:26 +01:00
Mariusz Felisiak e972620ada
Fixed #33462 -- Fixed migration crash when altering type of primary key with MTI and foreign key.
This prevents duplicated operations when altering type of primary key
with MTI and foreign key. Previously, a foreign key to the base model
was added twice, once directly and once by the inheritance model.

Thanks bcail for the report.

Regression in 325d7710ce.
2022-01-27 18:51:39 +01:00
Carlton Gibson d15a10afb5
Adjusted CBV resolver_match example in testing tools docs.
The view_class is available on the view callback, allowing that to be
checked, rather than the __name__.
2022-01-26 20:58:22 +01:00
Mariusz Felisiak f38c3cbadc
Increased test coverage for django.contrib.gis.gdal.layer.Layer. 2022-01-26 17:47:03 +01:00
Jacob Walls edbf930287 Fixed #29984 -- Added QuerySet.iterator() support for prefetching related objects.
Co-authored-by: Raphael Kimmig <raphael.kimmig@ampad.de>
Co-authored-by: Simon Charette <charette.s@gmail.com>
2022-01-25 06:12:04 +01:00
Timothy McCurrach efb4478e48 Fixed #33458 -- Fixed encoding of messages with empty string as extra_tags. 2022-01-24 07:05:53 +01:00
Claude Paroz 7c4f396509 Stopped including type="text/css" attributes for CSS link tags. 2022-01-22 16:38:14 +01:00
My-Name-Is-Nabil 9dc65263d4 Fixed #33455 -- Improved error message when selenium is not installed. 2022-01-21 21:54:10 +01:00
Jacob Walls 2d8232fa71 Fixed #26760 -- Added --prune option to migrate command. 2022-01-21 17:10:31 +01:00
Fabian Büchler eeff1787b0 Fixed #33449 -- Fixed makemigrations crash on models without Meta.order_with_respect_to but with _order field.
Regression in aa4acc164d.
2022-01-21 06:44:53 +01:00
Mariusz Felisiak f605e85af9
Fixed #33453 -- Dropped support for GDAL 2.1. 2022-01-20 18:54:29 +01:00
Hrushikesh Vaidya 3fadf141e6 Fixed #33062 -- Made MultiPartParser remove non-printable chars from file names. 2022-01-20 07:19:52 +01:00
sean_c_hsu 0f6946495a Fixed #31685 -- Added support for updating conflicts to QuerySet.bulk_create().
Thanks Florian Apolloner, Chris Jerdonek, Hannes Ljungberg, Nick Pope,
and Mariusz Felisiak for reviews.
2022-01-19 20:17:42 +01:00
Mariusz Felisiak 4a8ac604b1
Added tests for SpatialReference.to_esri()/from_esri(). 2022-01-19 16:03:04 +01:00
Adam Johnson dc8bb35e39 Fixed #33446 -- Added CSS source map support to ManifestStaticFilesStorage. 2022-01-18 12:53:14 +01:00
Mariusz Felisiak 30a0144134
Fixed #29338 -- Allowed using combined queryset in Subquery.
Thanks Eugene Kovalev for the initial patch, Simon Charette for the
review, and Chetan Khanna for help.
2022-01-17 18:01:07 +01:00
My-Name-Is-Nabil f37face331 Fixed #33435 -- Fixed invalid SQL generatered by Subquery.as_sql(). 2022-01-17 09:00:46 +01:00
Ayush Joshi 0a17666045 Fixed #28135 -- Made simplify_regex() handle non-capturing groups. 2022-01-14 11:01:02 +01:00
Adam Johnson fdfa97fb16 Fixed #33441 -- Restored immutability of models.Field.__hash__().
Regression in 502e75f9ed.
2022-01-14 07:00:48 +01:00
Adam Johnson 45a42aabfa Fixed #29708 -- Deprecated PickleSerializer. 2022-01-13 13:50:20 +01:00
Adam Johnson 436862787c Refs #29708 -- Made SessionBase store expiry as string. 2022-01-13 13:05:42 +01:00
Adam Johnson 08d8bccbf1 Improved Model.__init__() properties loop.
This improves readability, accumulates unrecognized arguments raise an
exception with all of them, and avoids refetching the values.
2022-01-13 11:09:37 +01:00
Mariusz Felisiak 0a4a5e5bac
Refs #32681 -- Fixed VariableDoesNotExist when rendering some admin template.
Regression in 84609b3205.

Follow up to 4e5bbb6ef2.

Thanks Sourav Kumar for the report.
2022-01-13 10:10:48 +01:00
Hrushikesh Vaidya 6815da6e94 Fixed #33396 -- Added view name to technical 500 debug page. 2022-01-13 07:02:41 +01:00
Adam Johnson 84e98ba194
Added exception to SuspiciousOperation logging.
This allows better debugging and filtering of errors.
2022-01-12 13:27:25 +01:00
Jacob Walls dc9deea8e8 Fixed #11715 -- Changed default value of ModelAdmin.actions/inlines to empty tuples.
This clarifies the intended pattern of overwriting the default value
rather than mutating it.
2022-01-11 12:22:49 +01:00
mgaligniana fa235004dd Fixed #13251 -- Made pre/post_delete signals dispatch the origin. 2022-01-11 08:06:18 +01:00
Jacob Walls 6f78cb6b13 Fixed #29026 -- Added --scriptable option to makemigrations. 2022-01-10 18:49:57 +01:00
Keryn Knight f4b06a3cc1 Fixed #33426 -- Fixed ResolverMatch.__repr_() for class-based views.
Regression in 7c08f26bf0.
2022-01-10 17:30:41 +01:00
Jacob Walls 3430093a46
Refs #32193 -- Removed python-memcached from test requirements.
Follow up to 05f3a6186e.
2022-01-10 06:39:15 +01:00
Keryn Knight 2a66c102d9 Fixed #33425 -- Fixed view name for CBVs on technical 404 debug page.
Regression in 0c0b87725b.
2022-01-08 13:05:55 +01:00
David 4c60c3edff Fixed #33419 -- Restored marking forms.Field.help_text as HTML safe.
Regression in 456466d932.

Thanks Matt Westcott for the report.
2022-01-07 15:35:31 +01:00
Ad Timmering bdf3e156b4 Fixed #28628 -- Changed \d to [0-9] in regexes where appropriate. 2022-01-07 12:25:06 +01:00
Ad Timmering fe76944269 Refs #28628 -- Added tests for intcomma with non-ASCII digits. 2022-01-07 12:23:33 +01:00
Allen Jonathan David 28c98d4113 Fixed #33216 -- Simpilified deconstructed paths for some expressions. 2022-01-07 11:19:29 +01:00
Baptiste Mispelon c67e1cf44f Refs #33348 -- Deprecated passing errors=None to SimpleTestCase.assertFormError()/assertFormsetErrors(). 2022-01-06 17:29:32 +01:00
Petter Friberg bc174e6ea0 Fixed #33410 -- Fixed recursive capturing of callbacks by TestCase.captureOnCommitCallbacks().
Regression in d89f976bdd.
2022-01-06 06:38:17 +01:00
Ad Timmering 806efe912b Fixed #33400 -- Added support for msg_prefix and count arguments to assertTemplateUsed()/assertTemplateNotUsed() used as context managers. 2022-01-05 12:49:42 +01:00
Jamie Matthews f5233dce30 Fixed #32511 -- Corrected handling prefetched nested reverse relationships.
When prefetching a set of child objects related to a set of parent
objects, we usually want to populate the relationship back from the
child to the parent to avoid a query when accessing that relationship
attribute. However, there's an edge case where the child queryset
itself specifies a prefetch back to the parent. In that case, we want
to use the prefetched relationship rather than populating the reverse
relationship from the parent.
2022-01-05 09:49:05 +01:00
Allen Jonathan David 205f67cd5b Refs #33216 -- Made @deconstructible do not change path for subclasses. 2022-01-04 13:15:29 +01:00
Allen Jonathan David 194ca77092 Refs #21275 -- Added more tests for @deconstructible decorator. 2022-01-04 13:08:36 +01:00
Florian Apolloner 6d343d01c5 Fixed CVE-2021-45452 -- Fixed potential path traversal in storage subsystem.
Thanks to Dennis Brinkrolf for the report.
2022-01-04 10:04:12 +01:00
Florian Apolloner 761f449e0d Fixed CVE-2021-45116 -- Fixed potential information disclosure in dictsort template filter.
Thanks to Dennis Brinkrolf for the report.

Co-authored-by: Adam Johnson <me@adamj.eu>
2022-01-04 10:03:56 +01:00
Florian Apolloner 968a3d01fa Fixed CVE-2021-45115 -- Prevented DoS vector in UserAttributeSimilarityValidator.
Thanks Chris Bailey for the report.

Co-authored-by: Adam Johnson <me@adamj.eu>
2022-01-04 10:02:05 +01:00
David Wobrock 482ee63b6f
Fixed #33402 -- Optimized multiple AlterFooTogether operations. 2022-01-04 06:24:03 +01:00
Keryn Knight 0ed2919814 Fixed #33406 -- Avoided creation of MaxLengthValidator(None) when resolving Value.output_field for strings.
This brings the behaviour in line with Field subclasses which append to
the validators within __init__(), like BinaryField, and prevents the
creation of a validator which incorrectly throws a TypeError, if it
were used.
2022-01-04 05:51:00 +01:00
Keryn Knight b894199eb0 Refs #33406 -- Added test for not creating broken validators when resolving Value.output_field. 2022-01-04 05:51:00 +01:00
Mariusz Felisiak 30613d6a74
Fixed #33408 -- Fixed adding nullable unique fields on SQLite.
Regression in 2f73e5406d.

Thanks Alan Crosswell for the report.
2022-01-04 05:50:00 +01:00
Jacob Walls 0ab58c1209 Refs #29026 -- Allowed customizing InteractiveMigrationQuestioner's prompt destination.
Previously, the questioner did not obey the value of stdout provided
to the command.
2022-01-03 12:30:51 +01:00
Jacob Walls 03a6488116
Refs #31026 -- Changed @jinja2_tests imports to be relative. 2022-01-03 06:11:30 +01:00
Mariusz Felisiak 826701232c
Removed obsolete Oracle's test_client_encoding() test.
encoding and nencoding parameters were deprecated in cx_Oracle 8.2.
Moreover, encoding is handled internally between cx_Oracle and Oracle
Database and there is no need to test it.
2021-12-30 12:42:37 +01:00
Shubh1815 aecfc40c88 Fixed #33300 -- Ensured hidden elements are not displayed on small screens. 2021-12-30 07:57:36 +01:00
Jacob Walls 92412aa94c Fixed #23273 -- Avoided creation of django_migrations table when there are no migrations to apply. 2021-12-30 06:36:55 +01:00
David Smith 950d697b95
Refs #31617 -- Removed redundant title text in filter.html.
Unnecessary since 269a767146.

Title text should provide advisory information and should not be the
same or very similar to the element text.
2021-12-28 13:42:35 +01:00
Mariusz Felisiak 2d07e1aaeb
Refs #22983 -- Added tests for squashing migrations with functions from migration files.
Follow up to ebb13bbd88.
2021-12-27 18:49:19 +01:00
Hannes Ljungberg 59a66f0512 Refs #33342 -- Deprecated ExclusionConstraint.opclasses. 2021-12-27 08:55:18 +01:00
Hannes Ljungberg 0e656c02fe Fixed #33342 -- Added support for using OpClass() in exclusion constraints. 2021-12-24 11:39:00 +01:00
Adam Johnson deec15a9a6 Refs #33355 -- Made trunc functions raise ValueError on invalid lookups on SQLite.
Co-Authored-By: Nick Pope <nick@nickpope.me.uk>
2021-12-23 11:47:13 +01:00
David cb82ded4b2 Refs #32339 -- Added rendering tests for forms with CheckboxSelectMultiple and SelectMultiple widgets. 2021-12-23 07:38:05 +01:00
Mariusz Felisiak ca04659b4b
Refs #32355 -- Bumped required psycopg2 version to 2.8.4.
psycopg2 2.8.4 is the first release to support Python 3.8.
2021-12-22 20:32:55 +01:00
Adam Johnson a8fa3e5cd7 Refs #33355 -- Added missing tests for database functions and expression on null values. 2021-12-22 11:46:18 +01:00
Baptiste Mispelon e95e6425ac Refs #24121 -- Added __repr__() to BaseFormSet. 2021-12-21 12:06:05 +01:00
Baptiste Mispelon 61b332499d Used assertRaisesMessage() in test_client_regress.AssertFormErrorTests. 2021-12-21 11:09:45 +01:00
David Wobrock 72b23c04d8 Fixed #33374 -- Fixed ExpressionWrapper annotations with full queryset. 2021-12-21 06:17:04 +01:00
Jacob Walls 03cadb912c Removed a Python error message dependency in test_questioner_no_default_bad_user_entry_code(). 2021-12-20 11:11:39 +01:00
Jacob Walls 1833a9eee9 Increased test coverage of django.db.migrations.questioner. 2021-12-20 11:11:39 +01:00
Alexander Filimonov 448145092c Refs #27674 -- Added tests for GISModelAdmin.gis_widget_kwargs. 2021-12-20 08:12:12 +01:00
mendespedro e8b4feddc3 Fixed #33367 -- Fixed URLValidator crash in some edge cases. 2021-12-20 07:30:22 +01:00
mendespedro 4fd3044ca0 Fixed #33368 -- Fixed parse_duration() crash on invalid separators for decimal fractions. 2021-12-20 06:46:34 +01:00
Simon Charette 4328970780 Fixed #33366 -- Fixed case handling with swappable setting detection in migrations autodetector.
The migration framework uniquely identifies models by case insensitive
labels composed of their app label and model names and so does the app
registry in most of its methods (e.g. AppConfig.get_model) but it
wasn't the case for get_swappable_settings_name() until this change.

This likely slipped under the radar for so long and only regressed in
b9df2b74b9 because prior to the changes
related to the usage of model states instead of rendered models in the
auto-detector the exact value settings value was never going through a
case folding hoop.

Thanks Andrew Chen Wang for the report and Keryn Knight for the
investigation.
2021-12-17 07:46:58 +01:00
Mariusz Felisiak 40165eecc4
Fixed #33350 -- Reallowed using cache decorators with duck-typed HttpRequest.
Regression in 3fd82a6241.

Thanks Terence Honles for the report.
2021-12-16 20:13:17 +01:00
mgaligniana 068b2c072b Fixed #30127 -- Deprecated name argument of cached_property(). 2021-12-16 18:52:27 +01:00
Mariusz Felisiak 882647a82c
Used subTest() in forms.URLField() tests. 2021-12-16 06:35:44 +01:00
mgaligniana ac5cc6cf01 Fixed #33316 -- Added pagination to admin history view. 2021-12-15 10:54:08 +01:00
Jacob Walls 76ccce64cc Fixed #16063 -- Adjusted admin changelist searches spanning multi-valued relationships.
This reduces the likelihood of admin searches issuing queries with
excessive joins.
2021-12-15 08:14:19 +01:00
Florian Apolloner e1d673c373 Fixed unescape_string_literal() crash on empty strings. 2021-12-14 20:19:44 +01:00
Florian Apolloner 5d9c512e5b Added test for ValueErrors in unescape_string_literal(). 2021-12-14 20:18:43 +01:00
mdalp 3b73f77ad4 Fixed #33358 -- Fixed handling timedelta < 1 day in schema operations on Oracle. 2021-12-14 09:08:25 +01:00
Jeremy Lainé 2f33217ea2 Fixed #33361 -- Fixed Redis cache backend crash on booleans. 2021-12-14 07:16:30 +01:00
Jeremy Lainé c7902612ca Refs #33361 -- Added Added DummyCache.set() test for boolean values. 2021-12-14 06:47:37 +01:00
mgaligniana e61abab6e0 Refs #33338 -- Added never_cache() tests for Expires header. 2021-12-13 15:32:24 +01:00
Adam Johnson 5111b636d9 Refs #33355 -- Fixed Trunc() with years < 1000 on SQLite.
Thanks to Nick Pope for spotting the bug in Code Review.

Co-Authored-By: Nick Pope <nick@nickpope.me.uk>
2021-12-13 11:50:45 +01:00
Mariusz Felisiak c66ecc5568 Refs #33355 -- Moved Trunc() assertions for invalid arguments and ISO 8601 week to separate tests. 2021-12-13 11:28:35 +01:00
mendespedro 75485d16a2 Fixed #33351 -- Made path()/re_path() raise TypeError when kwargs argument is not a dict. 2021-12-13 08:09:28 +01:00
Mariusz Felisiak 2f73e5406d Refs #32502 -- Avoided table rebuild when adding fields with no default on SQLite. 2021-12-10 17:13:05 +01:00
Adam Johnson 0d2435328a Added test for field names of ManagementForm. 2021-12-10 10:01:33 +01:00
Mariusz Felisiak 974e3b8750
Fixed inspectdb.tests.InspectDBTestCase.test_custom_fields() on SQLite 3.37+.
Use FlexibleFieldLookupDict which is case-insensitive mapping because
SQLite 3.37+ returns some data type names upper-cased e.g. TEXT.
2021-12-09 20:24:38 +01:00
Arsa 17df72114e Fixed #33340 -- Fixed unquoted column names in queries used by DatabaseCache. 2021-12-09 11:16:04 +01:00
David Smith eba9a9b7f7 Refs #32338 -- Added Boundfield.legend_tag(). 2021-12-09 07:16:33 +01:00
Ömer Faruk Abacı 81739a45b5 Fixed #33319 -- Fixed crash when combining with the | operator querysets with aliases that conflict. 2021-12-08 21:16:24 +01:00
Baptiste Mispelon cb383753c0 Fixed #33346 -- Fixed SimpleTestCase.assertFormsetError() crash on a formset named "form".
Thanks OutOfFocus4 for the report.

Regression in 456466d932.
2021-12-08 20:33:03 +01:00
Shreya Bamne 8a4e506760 Fixed #19721 -- Allowed admin filters to customize the list separator. 2021-12-08 15:25:52 +01:00
Mariusz Felisiak 513441240f
Updated asgiref dependency for 4.0 release series. 2021-12-07 09:49:39 +01:00
Florian Apolloner d4dcd5b9dd Fixed #30530, CVE-2021-44420 -- Fixed potential bypass of an upstream access control based on URL paths.
Thanks Sjoerd Job Postmus and TengMA(@te3t123) for reports.
2021-12-07 06:28:08 +01:00
Mariusz Felisiak 628b6a6869 Updated translations from Transifex.
This also fixes related i18n tests.

Forwardport of 4c5215ab03 from stable/4.0.x

Co-authored-by: Claude Paroz <claude@2xlibre.net>
2021-12-06 20:31:03 +01:00
Hannes Ljungberg 1eaf38fa87 Fixed #33335 -- Made model validation ignore functional unique constraints.
Regression in 3aa545281e.

Thanks Hervé Le Roy for the report.
2021-12-06 07:59:11 +01:00
Mariusz Felisiak d3a64bea51
Refs #33333 -- Fixed PickleabilityTestCase.test_annotation_with_callable_default() crash on Oracle.
Grouping by LOBs is not allowed on Oracle. This moves a binary field to
a separate model.
2021-12-04 15:55:03 +01:00
Maxim Piskunov d3f4c2b95d Fixed #33078 -- Added support for language regions in i18n_patterns(). 2021-12-03 12:57:06 +01:00
Mariusz Felisiak 4f7bbc6138 Refs #33078 -- Added extra assertions to MiscTests.test_get_language_from_path_real(). 2021-12-03 12:03:30 +01:00
Mariusz Felisiak 2c7846d992
Fixed #33333 -- Fixed setUpTestData() crash with models.BinaryField on PostgreSQL.
This makes models.BinaryField pickleable on PostgreSQL.

Regression in 3cf80d3fcf.

Thanks Adam Zimmerman for the report.
2021-12-03 11:56:22 +01:00
Mariusz Felisiak 5def7f3f74 Updated various links to HTTPS and new locations.
Co-Authored-By: Nick Pope <nick@nickpope.me.uk>
2021-12-02 11:27:29 +01:00
Simon Charette e5a92d400a Fixed #33282 -- Fixed a crash when OR'ing subquery and aggregation lookups.
As a QuerySet resolves to Query the outer column references grouping logic
should be defined on the latter and proxied from Subquery for the cases where
get_group_by_cols is called on unresolved expressions.

Thanks Antonio Terceiro for the report and initial patch.
2021-12-02 07:23:33 +01:00
Przemysław Suliga 4ce59f602e Fixed #30398 -- Added CONN_HEALTH_CHECKS database setting.
The CONN_HEALTH_CHECKS setting can be used to enable database
connection health checks for Django's persistent DB connections.

Thanks Florian Apolloner for reviews.
2021-12-01 07:44:48 +01:00
Claude Paroz 64c3f049ea Fixed #33047 -- Fixed CheckConstraint crash with GIS lookups on PostGIS and MySQL GIS backends.
Thanks Daniel Swain for the report and Arsalan Ghassemi for the initial
patch.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-11-30 20:06:29 +01:00
Chris Jerdonek 3ff7f6cf07 Refs #32800 -- Renamed _sanitize_token() to _check_token_format(). 2021-11-29 10:48:31 +01:00
Chris Jerdonek 5d80843ebc Fixed #32800 -- Changed CsrfViewMiddleware not to mask the CSRF secret.
This also adds CSRF_COOKIE_MASKED transitional setting helpful in
migrating multiple instance of the same project to Django 4.1+.

Thanks Florian Apolloner and Shai Berger for reviews.

Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-11-29 10:47:39 +01:00
Shubh1815 05e29da421 Fixed #32545 -- Improved admin widget for raw_id_fields for UUIDFields.
Co-Authored-By: Jerome Leclanche <jerome@leclan.ch>
2021-11-29 07:16:26 +01:00
Hannes Ljungberg ed2018037d Fixed #33322 -- Fixed loss of assigned related object when saving relation with bulk_update(). 2021-11-29 06:27:22 +01:00
Baptiste Mispelon 9ac92b1efc Refs #33301 -- Made SimpleTestCase.assertFormError()/assertFormsetErrors() raise ValueError for non test client responses. 2021-11-26 13:10:43 +01:00
Baptiste Mispelon 68144f4049 Added tests for SimpleTestCase.assertFormError()/assertFormsetErrors(). 2021-11-26 12:36:25 +01:00
Hasan Ramezani 24b316536a Fixed #33303 -- Changed messages' level tags on MESSAGE_TAGS setting change. 2021-11-26 07:09:31 +01:00
Ad Timmering 9a6e2df3a8 Fixed #32397 -- Made startapp/startproject management commands set User-Agent.
This sets User-Agent to 'Django/<version>'.
2021-11-25 20:36:04 +01:00
Shubh1815 51c24d8799 Fixed #33024 -- Fixed height of admin selector boxes in collapsed fieldset.
Thanks Tom Carrick for the review.
2021-11-25 07:57:19 +01:00
Ad Timmering 59f4796918 Fixed #4282 -- Made startapp/startproject management commands honor umask.
Co-authored-by: Christian Schmitt <c.schmitt@briefdomain.de>
2021-11-24 13:10:45 +01:00
mgaligniana 7f8f69fb38 Fixed #33298 -- Added docs and tests for using Q objects with get_object_or_404()/get_list_or_404(). 2021-11-24 09:28:21 +01:00
Tim Graham ddf321479b
Removed unneeded @skipUnlessDBFeature('supports_combined_alters').
The test acts a regression test for 715ccfde24
if the feature is True, but it works on other backends too.
2021-11-24 09:13:28 +01:00
Tim Graham 9772eaa6c0
Fixed typo in delete test docstring. 2021-11-24 09:04:54 +01:00
arsalan.ghassemi bdcda1ca9b Fixed #33309 -- Fixed QuerySet.distinct() crash on mixed case annotation. 2021-11-23 20:43:20 +01:00
Simon Charette aec71aaa5b Fixed #33304 -- Allowed passing string expressions to Window(order_by). 2021-11-23 07:58:44 +01:00
Baptiste Mispelon e6e664a711 Fixed #33302 -- Made element_id optional argument for json_script template filter.
Added versionchanged note in documentation
2021-11-22 11:52:19 +01:00
Baptiste Mispelon a0ed3cfad1 Fixed #33305 -- Fixed autodetector crash for ForeignKey with hardcoded "to" attribute.
Co-authored-by: Simon Charette <charette.s@gmail.com>
2021-11-22 06:46:25 +01:00
SwastikTripathi a7e7043c87 Fixed #33229 -- Fixed BaseDatabaseOperations.adapt_datetimefield_value()/adapt_timefield_value() crash with expressions. 2021-11-19 09:47:57 +01:00
Jonny Park 6fa2930573 Refs #24121 -- Added __repr__() to BaseDatabaseWrapper, JoinPromoter, and SQLCompiler. 2021-11-19 07:57:02 +01:00
Shubh1815 bb223c6f78 Fixed #28357 -- Fixed ModelAdmin.prepopulated_fields on newly added stacked inline.
Thanks Jakob Köhler for the initial patch.
2021-11-16 12:24:56 +01:00
Chris Jerdonek 3f0025c18a Refs #32800 -- Avoided use of _does_token_match() in some CSRF tests. 2021-11-16 11:21:30 +01:00
Chris Jerdonek 0820175d81 Refs #32800 -- Added CSRF tests for masked and unmasked secrets during GET. 2021-11-16 11:02:32 +01:00
SwastikTripathi 76f07b4fcf Fixed #33278 -- Improved error for connection/query attempts against disallowed databases in tests. 2021-11-15 11:46:10 +01:00
Simon Charette 483e30c3d5 Fixed #33288 -- Made SQLite introspection use information schema for relations.
Previous solution was using brittle and complex parsing rules to
extract them from the SQL used to define the tables.

Removed a now unnecessary unit test that ensured the removed parsing
logic accounted for optional spacing.
2021-11-15 08:07:07 +01:00
Simon Charette 30ec7fe89a Refs #33288 -- Made SQLite introspection raise DatabaseError on nonexistent tables.
All the other backends behave this way and we had to make adjustments
to our test suite to account for this discrepancy.

This also allows SQLite's get_relations() not to raise on a nonexistent
table while making sure the InspectDBTestCase.test_introspection_errors
test which ensures an error during introspection is surfaced in
generated models files still passes.
2021-11-15 07:57:00 +01:00
Krzysztof Jagiello 8d9827c06c Fixed #33161 -- Enabled durability check for nested atomic blocks in TestCase.
Co-Authored-By: Adam Johnson <me@adamj.eu>
2021-11-12 13:05:56 +01:00
Can Sarigol 661316b066 Fixed #33279 -- Fixed handling time zones with "-" sign in names.
Thanks yakimka for the report.

Regression in fde9b7d35e.
2021-11-12 07:30:02 +01:00
Lie Ryan 05cde4764d Fixed #33269 -- Made AnonymousUser/PermissionsMixin.has_perms() raise ValueError on string or non-iterable perm_list. 2021-11-11 20:26:29 +01:00
Ad Timmering 4bfe8c0eec Fixed #6106 -- Prevented makemessages from changing .po files when up to date.
Co-authored-by: Daniyal Abbasi <abbasi.daniyal98@gmail.com>
2021-11-11 09:12:05 +01:00
Mariusz Felisiak 0b95a96ee1
Removed DatabaseIntrospection.get_key_columns().
Thanks Simon Charette for the report.
2021-11-10 16:38:43 +01:00
Mariusz Felisiak 6bc437c0d8
Refs #33263 -- Added warning to BaseDeleteView when delete() method is overridden.
Follow up to 3a45fea083.
2021-11-09 09:03:40 +01:00
Jacob Walls 948d6d8805 Refs #16063 -- Added tests for searching against multiple related fields in admin changelist. 2021-11-09 07:00:36 +01:00
Baptiste Mispelon 91acfc3514 Fixed #33264 -- Made test runner return non-zero error code for unexpected successes. 2021-11-08 20:19:21 +01:00
Matthijs Kooijman 1a5023883b Fixed #33257 -- Fixed Case() and ExpressionWrapper() with decimal values on SQLite. 2021-11-08 18:02:56 +01:00
Keryn Knight 4f8c7fd9d9 Fixed #32980 -- Made models cache related managers. 2021-11-08 08:44:12 +01:00
Mariusz Felisiak ba9ced3e9a
Fixed #33253 -- Reverted "Fixed #32319 -- Added ES module support to ManifestStaticFilesStorage."
This reverts commit 91e21836f6.

`export` and `import` directives have several syntax variants and not
all of them were properly covered.

Thanks Hervé Le Roy for the report.
2021-11-05 12:11:18 +01:00
David Smith c6c6cd3c5a Fixed #33235 -- Removed "for = ..." from MultiWidget's <label>.
This improves accessibility for screen reader users.
2021-11-05 11:05:52 +01:00
Carlton Gibson 4816dc9428 Fixed #33237 -- Fixed detecting source maps in ManifestStaticFilesStorage for multiline files.
Switched regex to multiline mode in order to match per-line, rather
than against the whole file.

Thanks to Joseph Abrahams for the report.

Regression in 781b44240a.
2021-11-04 20:28:35 +01:00
Guilherme Martins Crocetti fc565cb539 Fixed #27147 -- Allowed specifying bounds of tuple inputs for non-discrete range fields. 2021-11-04 19:08:57 +01:00
Guilherme Martins Crocetti 52f6927d7f Refs #29738 -- Added test for serializing psycopg2's NumericRange with DecimalRangeField in migrations. 2021-11-04 19:08:57 +01:00
Hannes Ljungberg a934d377af Fixed #33262 -- Fixed crash of conditional aggregation on Exists(). 2021-11-04 06:31:32 +01:00
Hannes Ljungberg 25157033e9 Fixed #33260 -- Fixed crash when chaining QuerySet.exists() after select_for_update(of=()). 2021-11-03 20:08:14 +01:00
Keryn Knight a697424969 Fixed #32996 -- Cached PathInfos on relations.
PathInfo values are ostensibly static over the lifetime of the object
for which they're requested, so the data can be memoized, quickly
amortising the cost over the process' duration.
2021-11-03 11:27:04 +01:00
Iuri de Silvio 3ff7b15bb7 Fixed #33252 -- Made cache middlewares thread-safe. 2021-11-03 09:39:27 +01:00
Iuri de Silvio 0c05c183e4 Refs #33252 -- Used @override_settings in BaseCacheTests.test_cache_write_unpicklable_object() 2021-11-03 09:05:12 +01:00
Roman 407fe95cb1 Fixed #32691 -- Made Exact lookup on BooleanFields compare directly to a boolean value on MySQL.
Performance regression in 37e6c5b79b.

Thanks Todor Velichkov for the report.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-11-02 21:30:21 +01:00
jordan.bae aaf9b55858 Fixed #33187 -- Made inspectdb handle ForeignKey.to_field attribute. 2021-11-02 18:53:11 +01:00
Mariusz Felisiak dab48b7482
Fixed #33234 -- Fixed autodetector crash for proxy models inheriting from non-model class.
Regression in aa4acc164d.

Thanks Kevin Marsh for the report.
2021-11-02 15:34:08 +01:00
Hasan Ramezani c069ee0b9d Fixed #33224 -- Removed DatabaseFeatures.supports_mixed_date_datetime_comparisons. 2021-11-02 07:30:38 +01:00
andrewdotn 9e6d631697
Fixed #33246 -- Made squashmigrations raise CommandError when squashed_name already exists. 2021-11-02 07:13:42 +01:00
Mariusz Felisiak c3e0dfe4cc
Fixed isolation of admin_views.tests.ValidXHTMLTests. 2021-11-02 07:03:11 +01:00
Pratyush Mittal f38458fe56 Fixed #33236 -- Fixed assertHTMLEqual() error messages for escaped HTML. 2021-10-29 12:09:23 +02:00
Iuri de Silvio afeafd6036 Fixed #33201 -- Made RenameModel operation a noop for models with db_table. 2021-10-27 12:41:29 +02:00
Anv3sh 69af4d09ba Fixed #32672 -- Fixed introspection of primary key constraints on SQLite.
Thanks Simon Charette for the implementation idea.
2021-10-26 09:50:23 +02:00
Mariusz Felisiak d446f8ba08
Corrected AutodetectorTests.test_rename_field_and_foo_together()'s docstring. 2021-10-26 08:46:50 +02:00
Jacob Walls def09bf412 Fixed #27079 -- Avoided multiple setUpClass()/tearDownClass() calls in LiveServerTestCase tests. 2021-10-26 07:47:40 +02:00
Tim Graham cbd9f8531d
Removed duplicated lines in test_in_lookup_allows_F_expressions_and_expressions_for_datetimes(). 2021-10-26 07:22:20 +02:00
David Wobrock 0314593fe8 Fixed #31503 -- Made autodetector remove unique/index_together before altering fields. 2021-10-25 10:10:02 +02:00
Hasan Ramezani c1e4111c74 Fixed #33205 -- Made call_command() raise TypeError when dest with multiple arguments is passed. 2021-10-25 07:48:06 +02:00
Jacob Walls 1feb55d607
Fixed typo in tests/servers/tests.py. 2021-10-25 07:42:06 +02:00
Manaia Junior 551c997fea Fixed #33214 -- Added BaseDatabaseOperations.format_for_duration_arithmetic() stub method. 2021-10-22 08:19:02 +02:00
Mariusz Felisiak 9231526af4
Fixed #33215 -- Confirmed support for GEOS 3.10. 2021-10-21 20:23:58 +02:00