summaryrefslogtreecommitdiff
path: root/docs/howto
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2024-11-23 11:41:14 -0500
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-12-11 17:25:47 +0100
commit2ce4545de1791d6ed2405cb0657401e179bc5357 (patch)
tree6c4a837bfd9e1b0f19e06edb50f7dd99ca2b575b /docs/howto
parenta16eedcf9c69d8a11d94cac1811018c5b996d491 (diff)
Fixed #35920 -- Observed requires_system_checks in migrate and runserver.
Before, the full suite of system checks was run by these commands regardless if requires_system_checks had been overridden. Co-authored-by: Simon Charette <charette.s@gmail.com>
Diffstat (limited to 'docs/howto')
-rw-r--r--docs/howto/custom-management-commands.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt
index d3775905d3..de6c38c1e0 100644
--- a/docs/howto/custom-management-commands.txt
+++ b/docs/howto/custom-management-commands.txt
@@ -319,6 +319,21 @@ the :meth:`~BaseCommand.handle` method must be implemented.
checks, and list of database aliases in the ``databases`` to run database
related checks against them.
+.. method:: BaseCommand.get_check_kwargs(options)
+
+ .. versionadded:: 5.2
+
+ Supplies kwargs for the call to :meth:`check`, including transforming the
+ value of :attr:`requires_system_checks` to the ``tag`` kwarg.
+
+ Override this method to change the values supplied to :meth:`check`. For
+ example, to opt into database related checks you can override
+ ``get_check_kwargs()`` as follows::
+
+ def get_check_kwargs(self, options):
+ kwargs = super().get_check_kwargs(options)
+ return {**kwargs, "databases": [options["database"]]}
+
.. _ref-basecommand-subclasses:
``BaseCommand`` subclasses